From d362705e2861cb2f67e99b27fe21edd4c52a31dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Fri, 19 Nov 2021 14:38:01 +0100 Subject: [PATCH] Class --- README.md | 6 +++--- index.html | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 46e8d38..cb03be1 100644 --- a/README.md +++ b/README.md @@ -1027,9 +1027,9 @@ class MyClass: ``` ```python ->>> el = MyClass() ->>> el.a = 123 ->>> el.a +>>> obj = MyClass() +>>> obj.a = 123 +>>> obj.a 123 ``` diff --git a/index.html b/index.html index b59357b..fe008bf 100644 --- a/index.html +++ b/index.html @@ -1022,9 +1022,9 @@ Z = dataclasses.make_dataclass('Z', [ -
>>> el = MyClass()
->>> el.a = 123
->>> el.a
+
>>> obj = MyClass()
+>>> obj.a = 123
+>>> obj.a
 123
 

Dataclass

Decorator that automatically generates init(), repr() and eq() special methods.

from dataclasses import dataclass, field