MCPcopy Index your code
hub / github.com/python/cpython / is_dataclass

Function is_dataclass

Lib/dataclasses.py:1469–1473  ·  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

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

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…