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
def get_counter():
a = 0
a = 1
def out():
nonlocal a
a += 1
@ -593,7 +593,7 @@ def get_counter():
```python
>>> counter = get_counter()
>>> counter(), counter(), counter()
(0, 1, 2)
(1, 2, 3)
```

Loading…
Cancel
Save