mirror of
https://github.com/python/cpython.git
synced 2025-11-20 10:57:44 +00:00
#5469: add with statement to list of name-binding constructs.
This commit is contained in:
parent
09827eb55e
commit
173c1f1a01
1 changed files with 4 additions and 3 deletions
|
|
@ -87,9 +87,10 @@ subclass of :exc:`NameError`.
|
||||||
The following constructs bind names: formal parameters to functions,
|
The following constructs bind names: formal parameters to functions,
|
||||||
:keyword:`import` statements, class and function definitions (these bind the
|
:keyword:`import` statements, class and function definitions (these bind the
|
||||||
class or function name in the defining block), and targets that are identifiers
|
class or function name in the defining block), and targets that are identifiers
|
||||||
if occurring in an assignment, :keyword:`for` loop header, or in the second
|
if occurring in an assignment, :keyword:`for` loop header, in the second
|
||||||
position of an :keyword:`except` clause header. The :keyword:`import` statement
|
position of an :keyword:`except` clause header or after :keyword:`as` in a
|
||||||
of the form "``from ...import *``" binds all names defined in the imported
|
:keyword:`with` statement. The :keyword:`import` statement
|
||||||
|
of the form ``from ... import *`` binds all names defined in the imported
|
||||||
module, except those beginning with an underscore. This form may only be used
|
module, except those beginning with an underscore. This form may only be used
|
||||||
at the module level.
|
at the module level.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue