Skip to content

optype.dataclasses

For the dataclasses standard library, optype.dataclasses provides the HasDataclassFields interface. It can conveniently be used to check whether a type or instance is a dataclass, i.e. isinstance(obj, HasDataclassFields).

Warning

Starting in v0.17 HasDataclassFields is no longer generic. Previously it was generic -- HasDataclassFields[V: Mapping[str, Field]].