Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove 15-year-old TODO that causes lint errors
  • Loading branch information
hugovk committed Oct 6, 2022
commit a91cf65001817e2921a81faaa516a44b34b14060
8 changes: 0 additions & 8 deletions Doc/reference/simple_stmts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -994,20 +994,12 @@ The :keyword:`!nonlocal` statement
.. productionlist:: python-grammar
nonlocal_stmt: "nonlocal" `identifier` ("," `identifier`)*

.. XXX add when implemented
: ["=" (`target_list` "=")+ starred_expression]
: | "nonlocal" identifier augop expression_list

The :keyword:`nonlocal` statement causes the listed identifiers to refer to
previously bound variables in the nearest enclosing scope excluding globals.
This is important because the default behavior for binding is to search the
local namespace first. The statement allows encapsulated code to rebind
variables outside of the local scope besides the global (module) scope.

.. XXX not implemented
The :keyword:`nonlocal` statement may prepend an assignment or augmented
assignment, but not an expression.

Names listed in a :keyword:`nonlocal` statement, unlike those listed in a
:keyword:`global` statement, must refer to pre-existing bindings in an
enclosing scope (the scope in which a new binding should be created cannot
Expand Down