From 067b665ea9cc42880197ea8eb8a7a8e7e4ea35ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Mon, 28 Jan 2019 17:34:49 +0100 Subject: [PATCH] Class --- README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d62b3c7..f77aa5e 100644 --- a/README.md +++ b/README.md @@ -582,7 +582,7 @@ from functools import partial ```python def get_counter(): - a = 1 + a = 0 def out(): nonlocal a a += 1 @@ -722,11 +722,12 @@ class MySequence: ### Callable ```python -class MyCallable: - def __init__(self, a): - self.a = a +class Counter: + def __init__(self): + self.a = 0 def __call__(self): - return a + self.a += 1 + return self.a ``` ### Copy