buran Wrote:Unless PyQt is doing some weird stuff (which I doubt), it imports the whole PyQt.QtWidgets. As I said the difference is what references are available after that in the namespace.
I believe I covered that in my update which appears to have been a cross-post situation -- and your above statement does not counter the fact that doing it as
import PyQt.QtWidgets
is lazy coding as opposed to
from PyQt.QtWidgets import SpecificMethod
and I stand on the fact that lazy coding is bad coding but it gets perpetuated a lot
buran Wrote:Regarding the super()
- it's "mandatory" in case of multiple inheritance. And in case of single inheritance you can do just super().__init__(*args, **kwargs)
, i.e. it's not required to pass explicit reference inside super()
. In any case your statement that using super()
is wrong is misleading and incorrect. And in the example 8args, **kwargs
is just that - example.
No it is not misleading apparently you have not bothered to fully research
super( )
the rare case is just that a rather rare case and that almost every simpler program created especially by the folks that ask the simpler questions on here are never going to encounter that rare case and telling them to use
super()
without explaining the pitfalls is irresponsible and using it for anything but its rare case is lazy coding and thus bad coding as it adds a layer of complexity that is not needed and brings along with it the issues that get created by using
super( )
Issues mind you that if you do not understand because you are not aware if its pitfalls you can easily do more easily than using the explicit method