MCPcopy Index your code
hub / github.com/RustPython/RustPython / is_dataclass

Function is_dataclass

Lib/dataclasses.py:1468–1472  ·  view source on GitHub ↗

Returns True if obj is a dataclass or an instance of a dataclass.

(obj)

Source from the content-addressed store, hash-verified

1466
1467
1468def is_dataclass(obj):
1469 """Returns True if obj is a dataclass or an instance of a
1470 dataclass."""
1471 cls = obj if isinstance(obj, type) else type(obj)
1472 return hasattr(cls, _FIELDS)
1473
1474
1475def asdict(obj, *, dict_factory=dict):

Calls 2

isinstanceFunction · 0.85
hasattrFunction · 0.85