From: slateny <46876382+slateny@users.noreply.github.com> Date: Sun, 17 Apr 2022 21:20:13 +0000 (-0700) Subject: gh-89885: Improve import example in language reference (#91523) X-Git-Tag: v3.11.0b1~328 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d5a69571f586080af4c29671c47f9c4bc671af7f;p=thirdparty%2FPython%2Fcpython.git gh-89885: Improve import example in language reference (#91523) Co-authored-by: Jelle Zijlstra --- diff --git a/Doc/reference/import.rst b/Doc/reference/import.rst index 66737c698ae9..988d41c81c6a 100644 --- a/Doc/reference/import.rst +++ b/Doc/reference/import.rst @@ -490,21 +490,19 @@ submodule. Let's say you have the following directory structure:: spam/ __init__.py foo.py - bar.py -and ``spam/__init__.py`` has the following lines in it:: +and ``spam/__init__.py`` has the following line in it:: from .foo import Foo - from .bar import Bar -then executing the following puts a name binding to ``foo`` and ``bar`` in the +then executing the following puts name bindings for ``foo`` and ``Foo`` in the ``spam`` module:: >>> import spam >>> spam.foo - >>> spam.bar - + >>> spam.Foo + Given Python's familiar name binding rules this might seem surprising, but it's actually a fundamental feature of the import system. The invariant