跳到主要内容

AbstractAttrs

类数据类源码

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

该实例用于临时存放类的抽象成员。

当临时类摘要附带抽象类属性时,该集合将会启用。

字段​

字段类型必选
说明
propertieslist[property | cached_property]用来保存类的所有抽象属性。
methodslist[function | classmethod | staticmethod]用来保存类的所有抽象方法,包括实例、类、和静态方法。
operatorsdict[str, function]用来保存类的所有抽象运算符重载。

属性​

is_not_implemented​

is_not_implemented: bool = self.is_not_implemented

布尔标记。如果为True,则对应的抽象类型仍然有着没有实现的方法(成员)。