Skip to main content

ClassProfile

ClassDataClassSource

ClassProfile(
properties: list[property | cached_property] = [],
methods: list[function | classmethod | staticmethod] = [],
operators: dict[str, function] = dict(...),
abstract_attrs: AbstractAttrs | None = None
)

A temporary profile extracted from the class.

This profile is used only to aggregate a class's attributes. The information will be persisted by the following docstring conversion.

Fields

NameTypeRequired
Description
propertieslist[property | cached_property]All properties of this class.
methodslist[function | classmethod | staticmethod]All instance/class/static methods of this class.
operatorsdict[str, function]All overloaded operators of this class.
abstract_attrsAbstractAttrs | NoneOptional abstract attributes. It is None when the class is not abstract.

Methods

from_class

v_1: Self = ClassProfile.from_class(base_cls: type[Any])

Get the profile of a class.

Requires

NameTypeRequired
Description
base_clstype[Any]The class where the profile will be analyzed.

Returns

NameType
Description
v_1SelfThe analyzed class profile.