From a59cb90ff07b74c544c6b161155c5c255cfda846 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Tue, 23 Apr 2019 15:52:47 +0200 Subject: [PATCH] Class --- README.md | 2 ++ index.html | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/README.md b/README.md index bfea0f8..9edb057 100644 --- a/README.md +++ b/README.md @@ -837,6 +837,8 @@ class : def get_class_name(cls): return cls.__name__ ``` +* **Return value of repr() should be unambiguous and of str() readable.** +* **If only repr() is defined, it will also be used for str().** ### Constructor Overloading ```python diff --git a/index.html b/index.html index 0d3beaa..def0d9c 100644 --- a/index.html +++ b/index.html @@ -798,6 +798,10 @@ creature = Creature(Point(0, def get_class_name(cls): return cls.__name__ +

Constructor Overloading

class <name>:
     def __init__(self, a=None):