MCPcopy
hub / github.com/fluentpython/example-code-2e / _asdict

Function _asdict

24-class-metaprog/checked/decorator/checkeddeco.py:140–145  ·  view source on GitHub ↗
(self: Any)

Source from the content-addressed store, hash-verified

138 raise AttributeError(f'{cls_name} has no attribute{plural} {extra}')
139
140def _asdict(self: Any) -> dict[str, Any]:
141 return {
142 name: getattr(self, name)
143 for name, attr in self.__class__.__dict__.items()
144 if isinstance(attr, Field)
145 }
146
147def __repr__(self: Any) -> str:
148 kwargs = ', '.join(

Callers

nothing calls this directly

Calls 1

itemsMethod · 0.45

Tested by

no test coverage detected