config.basic.number =================== .. py:module:: config.basic.number .. autoapi-nested-parse:: 数值类型配置数据实现 .. versionadded:: 0.2.0 Classes ------- .. autoapisummary:: config.basic.number.BoolConfigData config.basic.number.NumberConfigData Module Contents --------------- .. py:class:: BoolConfigData(data: D | None = None) Bases: :py:obj:`NumberConfigData`\ [\ :py:obj:`BoolConfigData.D`\ ] 布尔值配置数据 .. versionadded:: 0.1.5 .. versionchanged:: 0.2.0 直接对参数调用 :py:class:`bool` :param data: 布尔值数据 :type data: D | None .. py:method:: __abs__() -> D .. py:method:: __add__(other: Any) -> Self .. py:method:: __and__(other: Any) -> Self .. py:method:: __bool__() -> bool .. py:method:: __ceil__() -> Any .. py:method:: __deepcopy__(memo: dict[str, Any]) -> Self .. py:method:: __eq__(other: Any) -> bool .. py:method:: __float__() -> float .. py:method:: __floor__() -> Any .. py:method:: __floordiv__(other: Any) -> Self .. py:method:: __format__(format_spec: str) -> str .. py:method:: __index__() -> Any .. py:method:: __int__() -> int .. py:method:: __invert__() -> Any .. py:method:: __lshift__(other: Any) -> Self .. py:method:: __matmul__(other: Any) -> Self .. py:method:: __mod__(other: Any) -> Self .. py:method:: __mul__(other: Any) -> Self .. py:method:: __neg__() -> Any .. py:method:: __or__(other: Any) -> Self .. py:method:: __pos__() -> Any .. py:method:: __pow__(other: Any) -> Self .. py:method:: __radd__(other: Any) -> Self .. py:method:: __rand__(other: Any) -> Self .. py:method:: __repr__() -> str .. py:method:: __rfloordiv__(other: Any) -> Self .. py:method:: __rlshift__(other: Any) -> Self .. py:method:: __rmatmul__(other: Any) -> Self .. py:method:: __rmod__(other: Any) -> Self .. py:method:: __rmul__(other: Any) -> Self .. py:method:: __ror__(other: Any) -> Self .. py:method:: __round__(ndigits: int | None = None) -> Any .. py:method:: __rpow__(other: Any) -> Self .. py:method:: __rrshift__(other: Any) -> Self .. py:method:: __rshift__(other: Any) -> Self .. py:method:: __rsub__(other: Any) -> Self .. py:method:: __rtruediv__(other: Any) -> Self .. py:method:: __rxor__(other: Any) -> Self .. py:method:: __str__() -> str .. py:method:: __sub__(other: Any) -> Self .. py:method:: __truediv__(other: Any) -> Self .. py:method:: __trunc__() -> Any .. py:method:: __xor__(other: Any) -> Self .. py:method:: freeze(freeze: bool | None = None) -> Self 冻结配置数据 (切换只读模式) :param freeze: 是否冻结配置数据, 为 :py:const:`None` 时进行切换 :type freeze: bool | None :return: 返回当前实例便于链式调用 :rtype: Self .. versionadded:: 0.1.5 .. py:method:: from_data(*args: Any, **kwargs: Any) -> Self :classmethod: 提供创建同类型配置数据的快捷方式 :return: 新的配置数据 :rtype: Self .. note:: 套壳 ``__init__`` 主要是为了方便内部快速创建与传入的ABCConfigData同类型的对象 例如: .. code-block:: python type(instance)(data) 可以简写为 .. code-block:: python instance.from_data(data) .. versionchanged:: 0.2.0 现在会自适应初始化参数 .. py:attribute:: __hash__ :value: None .. py:attribute:: __slots__ :value: () .. py:attribute:: _data :type: BoolConfigData.D .. py:attribute:: _read_only :type: bool | None :value: False .. py:attribute:: data :type: BoolConfigData.D 配置的原始数据 .. caution:: 未默认做深拷贝,可能导致非预期的行为 .. versionchanged:: 0.3.0 现在是可写属性 .. py:property:: data_read_only :type: Literal[False] 配置数据是否为只读 :return: 配置数据是否为只读 :rtype: Literal[False] .. note:: 该配置数据类始终认为配置数据非只读,使其能正确作为配置数据容器使用 .. py:property:: read_only :type: bool | None 配置数据是否为 ``只读模式`` :return: 配置数据是否为 ``只读模式`` :rtype: bool | None .. py:class:: NumberConfigData(data: D | None = None) Bases: :py:obj:`config.basic.core.BasicSingleConfigData`\ [\ :py:obj:`NumberConfigData.D`\ ] 数值配置数据 .. versionadded:: 0.1.5 :param data: 数值数据 :type data: D | None .. py:method:: __abs__() -> D .. py:method:: __add__(other: Any) -> Self .. py:method:: __and__(other: Any) -> Self .. py:method:: __bool__() -> bool .. py:method:: __ceil__() -> Any .. py:method:: __deepcopy__(memo: dict[str, Any]) -> Self .. py:method:: __eq__(other: Any) -> bool .. py:method:: __float__() -> float .. py:method:: __floor__() -> Any .. py:method:: __floordiv__(other: Any) -> Self .. py:method:: __format__(format_spec: str) -> str .. py:method:: __index__() -> Any .. py:method:: __int__() -> int .. py:method:: __invert__() -> Any .. py:method:: __lshift__(other: Any) -> Self .. py:method:: __matmul__(other: Any) -> Self .. py:method:: __mod__(other: Any) -> Self .. py:method:: __mul__(other: Any) -> Self .. py:method:: __neg__() -> Any .. py:method:: __or__(other: Any) -> Self .. py:method:: __pos__() -> Any .. py:method:: __pow__(other: Any) -> Self .. py:method:: __radd__(other: Any) -> Self .. py:method:: __rand__(other: Any) -> Self .. py:method:: __repr__() -> str .. py:method:: __rfloordiv__(other: Any) -> Self .. py:method:: __rlshift__(other: Any) -> Self .. py:method:: __rmatmul__(other: Any) -> Self .. py:method:: __rmod__(other: Any) -> Self .. py:method:: __rmul__(other: Any) -> Self .. py:method:: __ror__(other: Any) -> Self .. py:method:: __round__(ndigits: int | None = None) -> Any .. py:method:: __rpow__(other: Any) -> Self .. py:method:: __rrshift__(other: Any) -> Self .. py:method:: __rshift__(other: Any) -> Self .. py:method:: __rsub__(other: Any) -> Self .. py:method:: __rtruediv__(other: Any) -> Self .. py:method:: __rxor__(other: Any) -> Self .. py:method:: __str__() -> str .. py:method:: __sub__(other: Any) -> Self .. py:method:: __truediv__(other: Any) -> Self .. py:method:: __trunc__() -> Any .. py:method:: __xor__(other: Any) -> Self .. py:method:: freeze(freeze: bool | None = None) -> Self 冻结配置数据 (切换只读模式) :param freeze: 是否冻结配置数据, 为 :py:const:`None` 时进行切换 :type freeze: bool | None :return: 返回当前实例便于链式调用 :rtype: Self .. versionadded:: 0.1.5 .. py:method:: from_data(*args: Any, **kwargs: Any) -> Self :classmethod: 提供创建同类型配置数据的快捷方式 :return: 新的配置数据 :rtype: Self .. note:: 套壳 ``__init__`` 主要是为了方便内部快速创建与传入的ABCConfigData同类型的对象 例如: .. code-block:: python type(instance)(data) 可以简写为 .. code-block:: python instance.from_data(data) .. versionchanged:: 0.2.0 现在会自适应初始化参数 .. py:attribute:: __hash__ :value: None .. py:attribute:: __slots__ :value: () .. py:attribute:: _data :type: NumberConfigData.D .. py:attribute:: _read_only :type: bool | None :value: False .. py:property:: data :type: D 配置的原始数据 .. caution:: 未默认做深拷贝,可能导致非预期的行为 .. versionchanged:: 0.3.0 现在是可写属性 .. py:property:: data_read_only :type: Literal[False] 配置数据是否为只读 :return: 配置数据是否为只读 :rtype: Literal[False] .. note:: 该配置数据类始终认为配置数据非只读,使其能正确作为配置数据容器使用 .. py:property:: read_only :type: bool | None 配置数据是否为 ``只读模式`` :return: 配置数据是否为 ``只读模式`` :rtype: bool | None