mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
parent
2206cd17ce
commit
13dd9d9978
1 changed files with 1 additions and 5 deletions
|
|
@ -678,11 +678,7 @@ The first form of \keyword{import} statement binds the module name in
|
|||
the local namespace to the module object, and then goes on to import
|
||||
the next identifier, if any. If the module name is followed by
|
||||
\keyword{as}, the name following \keyword{as} is used as the local
|
||||
name for the module. To avoid confusion, you cannot import modules
|
||||
with dotted names \keyword{as} a different local name. So \code{import
|
||||
module as m} is legal, but \code{import module.submod as s} is not.
|
||||
The latter should be written as \code{from module import submod as s};
|
||||
see below.
|
||||
name for the module.
|
||||
|
||||
The \keyword{from} form does not bind the module name: it goes through the
|
||||
list of identifiers, looks each one of them up in the module found in step
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue