mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Note the sole case in which the ban on "from ... import *" within a
function is enforced.
This commit is contained in:
parent
15b68976da
commit
f0c1f1badb
1 changed files with 5 additions and 1 deletions
|
@ -680,7 +680,11 @@ defined, the set of public names includes all names found in the
|
|||
module's namespace which do not begin with an underscore character
|
||||
(\character{_}).
|
||||
|
||||
The \keyword{from} form with \samp{*} may only occur in a module scope.
|
||||
The \keyword{from} form with \samp{*} may only occur in a module
|
||||
scope. If the wild card form of import --- \samp{import *} --- is
|
||||
used in a function and the function contains or is a nested block with
|
||||
free variables, the compiler will raise a \exception{SyntaxError}.
|
||||
|
||||
\kwindex{from}
|
||||
\stindex{from}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue