Lines Matching refs:dataclass

15 __all__ = ['dataclass',
33 # dataclass decorator takes. For all of these tables, when I talk
35 # referring to the arguments to the @dataclass decorator. When
153 # @dataclass).
214 # @dataclass.
370 """Return an object to identify dataclass fields.
379 which is stored but not otherwise examined by dataclass. If kw_only
687 # @dataclass
692 # @dataclass
702 # a eval() penalty for every single field of every dataclass
897 # such dataclass won't be fully introspectable
988 raise TypeError('cannot inherit non-frozen dataclass from a '
993 raise TypeError('cannot inherit frozen dataclass from a '
997 # also marks this class as being a dataclass.
1129 # use setattr because dataclass may be frozen
1202 def dataclass(cls=None, /, *, init=True, repr=True, eq=True, order=False,
1224 # See if we're being called as @dataclass or @dataclass().
1229 # We're called as @dataclass without parens.
1234 """Return a tuple describing the fields of this dataclass.
1236 Accepts a dataclass or an instance of one. Tuple elements are of
1244 raise TypeError('must be called with a dataclass type or instance') from None
1252 """Returns True if obj is an instance of a dataclass."""
1257 """Returns True if obj is a dataclass or an instance of a
1258 dataclass."""
1264 """Return the fields of a dataclass instance as a new dictionary mapping
1269 @dataclass
1279 dataclass instances. This will also look into built-in containers:
1283 raise TypeError("asdict() should be called on dataclass instances")
1329 """Return the fields of a dataclass instance as a new tuple of field values.
1333 @dataclass
1343 dataclass instances. This will also look into built-in containers:
1348 raise TypeError("astuple() should be called on dataclass instances")
1383 """Return a new dynamically created dataclass.
1385 The dataclass name will be 'cls_name'. 'fields' is an iterable
1394 @dataclass
1403 dataclass().
1447 return dataclass(cls, init=init, repr=repr, eq=eq, order=order,
1458 @dataclass(frozen=True)
1472 raise TypeError("replace() should be called on dataclass instances")