asyncutils.constants

Exports sentinels and public constants.

Attributes

EXECUTORS_FROZENSET

Equivalent to frozenset(POSSIBLE_EXECUTORS), so that there can be faster membership testing.

POSSIBLE_EXECUTORS

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.

RAISE

Can be passed to some functions that are documented to support it, so that errors will be raised in the specified cases.

RECIP_E

The reciprocal of Euler's number, used by aguessmin() and aguessmax().

Classes

sentinel_base

Base class for sentinel values. To support versions below Python 3.15, we cannot make use of the PEP 661 built-in sentinel type, and this class offers extra methods anyway.

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 sentinel type, and this class offers extra methods anyway.

classmethod __init_subclass__(*, lock_impl: collections.abc.Callable[[], threading.Lock] = ...) None[source]

lock_impl is a callable that takes no arguments and returns a _synchronous_ lock (e.g. _thread.allocate_lock()).

__reduce__() tuple[type[Self], tuple[str]][source]

Support for pickling.

__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 back: str | None

The unqualified name of the sentinel, or None if there is none.

property bound_to: str | None

The name of the class the sentinel is bound to, or None if there is none.

property is_private: bool

Whether the sentinel is private; that is, the name begins with underscore.

property module: str

The name of the module the sentinel is defined in.

property name: str

Fully qualified name of the sentinel, the only thing that identifies it uniquely. May not be present if impropertly instantiated.

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.

asyncutils.constants.RECIP_E: Final[float]

The reciprocal of Euler’s number, used by aguessmin() and aguessmax().