[issue45722] documentation missing information on objects in submodules
Terry J. Reedy
report at bugs.python.org
Fri Nov 5 22:13:33 EDT 2021
Terry J. Reedy <tjreedy at udel.edu> added the comment:
https://docs.python.org/3/reference/import.html#submodules
The point of the section is that even though the names 'for' and 'bar' are not directly importing into 'spam', they get attached to 'spam' any way as indirect effect of 'from'. 'Foo' and 'Bar are directly imported and so are also bound. How about
"Executing the following puts a name binding to foo and bar (as well as Foo and Bar) in the spam module:
>>> spam.Foo
<class spam.foo.Foo>
(This should be checked in case the .foo changes the report.)
I think one example showing both foo and Foo would be enough.
----------
nosy: +terry.reedy
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45722>
_______________________________________
More information about the Python-bugs-list
mailing list