From 389733a24a03e9bbb0596ab1711257571d5e688d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Wed, 19 Dec 2018 10:34:57 +0100 Subject: [PATCH] Class --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7f6ff10..221a998 100644 --- a/README.md +++ b/README.md @@ -506,7 +506,7 @@ class : #### Constructor overloading: ```python -class C: +class : def __init__(self, a=None): self.a = a ``` @@ -552,6 +552,7 @@ Cutlery = Enum('Cutlery', {'knife': 1, 'fork': 2, 'spoon': 3}) # Functions can not be values, so they must be enclosed in tuple: LogicOp = Enum('LogicOp', {'AND': (lambda l, r: l and r, ), 'OR' : (lambda l, r: l or r, )} + # But 'list()' will only work if there is another value in the tuple: LogicOp = Enum('LogicOp', {'AND': (auto(), lambda l, r: l and r), 'OR' : (auto(), lambda l, r: l or r)}