asyncutils.constants¶
Exports sentinels and public constants.
Attributes¶
Equivalent to |
|
A tuple of all possible executor names that can be passed to -e, in rough order of preference and popularity. Also the order in which the executor options appear in the CLI help. |
|
Can be passed to some functions that are documented to support it, so that errors will be raised in the specified cases. |
|
The reciprocal of Euler's number, used by |
Classes¶
Base class for sentinel values. To support versions below Python 3.15, we cannot make use of the PEP 661 built-in |
Module Contents¶
- class asyncutils.constants.sentinel_base[source]¶
Base class for sentinel values. To support versions below Python 3.15, we cannot make use of the PEP 661 built-in
sentineltype, and this class offers extra methods anyway.- classmethod __init_subclass__(*, lock_impl: collections.abc.Callable[[], threading.Lock] = ...) None[source]¶
lock_implis a callable that takes no arguments and returns a _synchronous_ lock (e.g._thread.allocate_lock()).
- __set_name__(owner: type, name: str, /) None[source]¶
Bind the sentinel to a class and assign its name, if no arguments were passed to the constructor.
- is_(other: object, /) bool[source]¶
operator.is_()for sentinels.
- property bound_to: str | None¶
The name of the class the sentinel is bound to, or
Noneif there is none.
- asyncutils.constants.EXECUTORS_FROZENSET: Final[frozenset[asyncutils._internal.types.Executor]]¶
Equivalent to
frozenset(POSSIBLE_EXECUTORS), so that there can be faster membership testing.
- asyncutils.constants.POSSIBLE_EXECUTORS: Final[tuple[asyncutils._internal.types.Executor, Ellipsis]]¶
A tuple of all possible executor names that can be passed to -e, in rough order of preference and popularity. Also the order in which the executor options appear in the CLI help.
- asyncutils.constants.RAISE: Final[asyncutils._internal.types.RaiseType]¶
Can be passed to some functions that are documented to support it, so that errors will be raised in the specified cases.