@@ -1193,19 +1193,18 @@ def _add_slots(cls, is_frozen, weakref_slot):
1193
1193
def dataclass (cls = None , / , * , init = True , repr = True , eq = True , order = False ,
1194
1194
unsafe_hash = False , frozen = False , match_args = True ,
1195
1195
kw_only = False , slots = False , weakref_slot = False ):
1196
- """Returns the same class as was passed in, with dunder methods
1197
- added based on the fields defined in the class.
1196
+ """Add dunder methods based on the fields defined in the class.
1198
1197
1199
1198
Examines PEP 526 __annotations__ to determine fields.
1200
1199
1201
- If init is true, an __init__() method is added to the class. If
1202
- repr is true, a __repr__() method is added. If order is true, rich
1200
+ If init is true, an __init__() method is added to the class. If repr
1201
+ is true, a __repr__() method is added. If order is true, rich
1203
1202
comparison dunder methods are added. If unsafe_hash is true, a
1204
- __hash__() method function is added. If frozen is true, fields may
1205
- not be assigned to after instance creation. If match_args is true,
1206
- the __match_args__ tuple is added. If kw_only is true, then by
1207
- default all fields are keyword-only. If slots is true, an
1208
- __slots__ attribute is added .
1203
+ __hash__() method is added. If frozen is true, fields may not be
1204
+ assigned to after instance creation. If match_args is true, the
1205
+ __match_args__ tuple is added. If kw_only is true, then by default
1206
+ all fields are keyword-only. If slots is true, a new class with a
1207
+ __slots__ attribute is returned .
1209
1208
"""
1210
1209
1211
1210
def wrap (cls ):
0 commit comments