Browse Source

Class

pull/10/head
Jure Šorn 5 years ago
parent
commit
067b665ea9
1 changed files with 6 additions and 5 deletions
  1. 11
      README.md

11
README.md

@ -582,7 +582,7 @@ from functools import partial
```python ```python
def get_counter(): def get_counter():
a = 1
a = 0
def out(): def out():
nonlocal a nonlocal a
a += 1 a += 1
@ -722,11 +722,12 @@ class MySequence:
### Callable ### Callable
```python ```python
class MyCallable:
def __init__(self, a):
self.a = a
class Counter:
def __init__(self):
self.a = 0
def __call__(self): def __call__(self):
return a
self.a += 1
return self.a
``` ```
### Copy ### Copy

Loading…
Cancel
Save