Skip to main content

is_dataclass

No overview available.

def is_dataclass(
obj: object
) - > boolean

Checks if an object or class is a dataclass or an instance of a dataclass. Use this to distinguish dataclass types from regular classes or other data structures during runtime type inspection.

Parameters

NameTypeDescription
objobjectThe class or instance to be inspected for dataclass properties

Returns

TypeDescription
booleanTrue if the provided object is a dataclass or an instance of one, False otherwise