Browse Source

Nonlocal

pull/10/head
Jure Šorn 5 years ago
parent
commit
c8f2cde9be
1 changed files with 2 additions and 2 deletions
  1. 4
      README.md

4
README.md

@ -582,7 +582,7 @@ from functools import partial
```python ```python
def get_counter(): def get_counter():
a = 0
a = 1
def out(): def out():
nonlocal a nonlocal a
a += 1 a += 1
@ -593,7 +593,7 @@ def get_counter():
```python ```python
>>> counter = get_counter() >>> counter = get_counter()
>>> counter(), counter(), counter() >>> counter(), counter(), counter()
(0, 1, 2)
(1, 2, 3)
``` ```

Loading…
Cancel
Save