File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -490,21 +490,19 @@ submodule. Let's say you have the following directory structure::
490490 spam/
491491 __init__.py
492492 foo.py
493- bar.py
494493
495- and ``spam/__init__.py `` has the following lines in it::
494+ and ``spam/__init__.py `` has the following line in it::
496495
497496 from .foo import Foo
498- from .bar import Bar
499497
500- then executing the following puts a name binding to ``foo `` and ``bar `` in the
498+ then executing the following puts name bindings for ``foo `` and ``Foo `` in the
501499``spam `` module::
502500
503501 >>> import spam
504502 >>> spam.foo
505503 <module 'spam.foo' from '/tmp/imports/spam/foo.py'>
506- >>> spam.bar
507- <module 'spam.bar' from '/tmp/imports/spam/bar.py '>
504+ >>> spam.Foo
505+ <class 'spam.foo.Foo '>
508506
509507Given Python's familiar name binding rules this might seem surprising, but
510508it's actually a fundamental feature of the import system. The invariant
You can’t perform that action at this time.
0 commit comments