diff --git a/README.md b/README.md index 5cbe6bd..5438d18 100644 --- a/README.md +++ b/README.md @@ -872,7 +872,7 @@ class C(A, B): pass ``` ### Dataclass -**Decorator that automatically generates init(), repr() and eq() magic methods. Object can also be made sortable with `'order=True'` and/or immutable with `'frozen=True'`.** +**Decorator that automatically generates init(), repr() and eq() magic methods.** ```python from dataclasses import dataclass, field @@ -882,6 +882,7 @@ class : : = : list/dict/set = field(default_factory=list/dict/set) ``` +* **An object can be made sortable with `'order=True'` or immutable with `'frozen=True'`.** * **Function field() is needed because `': list = []'` would make a list that is shared among all instances.** * **Default_factory can be any callable.** diff --git a/index.html b/index.html index fd3f9c8..cc10afc 100644 --- a/index.html +++ b/index.html @@ -777,7 +777,7 @@ creature = Creature(Point(0, class 'C'>, <class 'A'>, <class 'B'>, <class 'object'>]

Dataclass

-

Decorator that automatically generates init(), repr() and eq() magic methods. Object can also be made sortable with 'order=True' and/or immutable with 'frozen=True'.

+

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

from dataclasses import dataclass, field
 
 @dataclass(order=False, frozen=False)
@@ -787,6 +787,7 @@ creature  = Creature(Point(0, 'order=True' or immutable with 'frozen=True'.
 
  • Function field() is needed because '<attr_name>: list = []' would make a list that is shared among all instances.
  • Default_factory can be any callable.