Le 09/12/2019 à 09:15, R.Wieser a écrit :
...
You'll find that *any* form of import executes all the top-level code.

Thats certainly something I did not expect.

How could it be otherwise? Consider a module defining two
classes: Parent and Child, Child inheriting from Parent.

if you do "from the_module import Child", how could it
not execute the code defining Parent as well? Child
*depends* on Parent.


--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to