asyncutils.constants¶
Exports sentinels and public constants.
Attributes¶
Equivalent to |
|
Sentinel requesting |
|
A tuple of all possible executor names that can be passed to |
|
Sentinel requesting an error be raised in some cases. Can only be passed to functions that are documented to support it. |
|
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.SentinelBase[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.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.
- 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.prots.Executor]]¶
Equivalent to
frozenset(POSSIBLE_EXECUTORS), so that there can be faster membership testing.
- asyncutils.constants.NO_COALESCE: Final[asyncutils._internal.prots.NoCoalesce]¶
Sentinel requesting
coalesce()not to combine two adjacent values.
- asyncutils.constants.POSSIBLE_EXECUTORS: Final[tuple[asyncutils._internal.prots.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.prots.Raise]¶
Sentinel requesting an error be raised in some cases. Can only be passed to functions that are documented to support it.
- asyncutils.constants.RECIPROCAL_E: Final[float]¶
The reciprocal of Euler’s number, used by
aguessmin()andaguessmax().