mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Add news about nonlocal statement
This commit is contained in:
parent
17e43e582c
commit
a4f9fc6494
1 changed files with 15 additions and 0 deletions
15
Misc/NEWS
15
Misc/NEWS
|
@ -62,6 +62,21 @@ Core and Builtins
|
|||
|
||||
- Added function annotations per PEP 3107.
|
||||
|
||||
- Added nonlocal declaration from PEP 3104
|
||||
|
||||
>>> def f(x):
|
||||
... def inc():
|
||||
... nonlocal x
|
||||
... x += 1
|
||||
... return x
|
||||
... return inc
|
||||
...
|
||||
>>> inc = f(0)
|
||||
>>> inc()
|
||||
1
|
||||
>>> inc()
|
||||
2
|
||||
|
||||
- Moved intern() to sys.intern().
|
||||
|
||||
- exec is now a function.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue