config.utils ============ .. py:module:: config.utils .. autoapi-nested-parse:: 杂项实用程序 .. versionadded:: 0.2.0 Attributes ---------- .. autoapisummary:: config.utils.Unset Classes ------- .. autoapisummary:: config.utils.FrozenArguments config.utils.Ref config.utils.UnsetType Functions --------- .. autoapisummary:: config.utils.singleton Module Contents --------------- .. py:class:: FrozenArguments(args: collections.abc.Sequence[Any] | None = None, kwargs: collections.abc.Mapping[str, Any] | None = None) 存储冻结的参数的容器 .. versionadded:: 0.3.0 :param args: 位置参数 :type args: Sequence[Any] :param kwargs: 关键字参数 :type kwargs: Mapping[str, Any] .. py:method:: __eq__(other: Any) -> bool .. py:method:: __hash__() -> int .. py:method:: __iter__() -> collections.abc.Iterator[tuple[Any, Ellipsis] | collections.OrderedDict[str, Any]] .. py:method:: __or__(other: tuple[collections.abc.Sequence[Any], collections.abc.Mapping[str, Any]] | Self) -> Self | types.NotImplementedType .. py:attribute:: _args :value: () .. py:attribute:: _kwargs :type: tuple[tuple[str, Any], Ellipsis] :value: () .. py:property:: args :type: tuple[Any, Ellipsis] 位置参数 :return: 位置参数 :rtype: tuple[Any] .. py:property:: kwargs :type: collections.OrderedDict[str, Any] 关键字参数 :return: 关键字参数 :rtype: OrderedDict[str, Any] .. py:class:: Ref(value: T) 间接持有对象引用的容器 .. versionchanged:: 0.3.0 重命名 ``CellType`` 为 ``Ref`` 重命名字段 ``cell_contents`` 为 ``value`` :param value: 引用对象 :type value: T .. py:method:: __repr__() -> str .. py:attribute:: __slots__ :value: ('value',) .. py:attribute:: value .. py:class:: UnsetType 用于填充默认值的特殊值 .. py:method:: __bool__() -> bool .. py:method:: __str__() -> str .. py:attribute:: __slots__ :value: () .. py:function:: singleton(target_cls: singleton.C, /) -> singleton.C 单例模式类装饰器 :param target_cls: 目标类 :type target_cls: C :return: 装饰后的类 :rtype: C .. py:data:: Unset 用于填充默认值的特殊值