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 @@ -483,21 +483,19 @@ submodule. Let's say you have the following directory structure::
483
483
spam/
484
484
__init__.py
485
485
foo.py
486
- bar.py
487
486
488
- and ``spam/__init__.py `` has the following lines in it::
487
+ and ``spam/__init__.py `` has the following line in it::
489
488
490
489
from .foo import Foo
491
- from .bar import Bar
492
490
493
- then executing the following puts a name binding to ``foo `` and ``bar `` in the
491
+ then executing the following puts name bindings for ``foo `` and ``Foo `` in the
494
492
``spam `` module::
495
493
496
494
>>> import spam
497
495
>>> spam.foo
498
496
<module 'spam.foo' from '/tmp/imports/spam/foo.py'>
499
- >>> spam.bar
500
- <module 'spam.bar' from '/tmp/imports/spam/bar.py '>
497
+ >>> spam.Foo
498
+ <class 'spam.foo.Foo '>
501
499
502
500
Given Python's familiar name binding rules this might seem surprising, but
503
501
it's actually a fundamental feature of the import system. The invariant
You can’t perform that action at this time.
0 commit comments