asyncutils._internal.helpers

Miscellaneous helper functions for asyncutils submodules that are not meant to be seen by the user.

Warning

These are undocumented and unstable, and will remain so. This stub file exists for the convenience of development only.

Classes

Bag

A thin dictionary subclass that supports attribute access.

LoopMixinBase

Functions

audit_fullname(→ None)

check(→ bool)

check_methods(→ bool)

coerce_callable(…)

copy_and_clear(→ T)

create_executor(→ asyncutils.config.Executor)

filter_out(→ collections.abc.Generator[Any])

fullname(→ str)

get_loop_and_set(→ asyncio.AbstractEventLoop)

ismodule(→ TypeGuard[types.ModuleType])

simple_wrap(→ T)

subscriptable(→ T)

verify_compat(→ None)

Module Contents

class asyncutils._internal.helpers.Bag[source]

Bases: dict[str, Any]

A thin dictionary subclass that supports attribute access.

Initialize self. See help(type(self)) for accurate signature.

__delattr__(key: str, /) None

Implement delattr(self, name).

__getattr__(key: str, /) Any[source]
__setattr__(key: str, value: object, /) None

Implement setattr(self, name, value).

class asyncutils._internal.helpers.LoopMixinBase[source]
make[T](aw: collections.abc.Awaitable[T], /) asyncio.Task[T][source]

Create a Task for the given awaitable that runs in the underlying loop.

make_fut() asyncio.Future[Any][source]

Create a Future attached to the underlying loop.

make_multiple[T](
aws: collections.abc.Iterable[collections.abc.Awaitable[T]],
/,
) collections.abc.Generator[asyncio.Task[T]][source]

Return an iterator over instances of Task created for each coroutine in C, in that order.

property loop: asyncio.AbstractEventLoop

The underlying event loop.

asyncutils._internal.helpers.audit_fullname(f: object, /, rmpref: bool = ...) None[source]
asyncutils._internal.helpers.check(candidate: object, against: object, /) bool[source]
asyncutils._internal.helpers.check_methods(obj: object, /, *meth: str) bool[source]
asyncutils._internal.helpers.coerce_callable[T: collections.abc.Callable[Ellipsis, Any]](f: T, /) T[source]
asyncutils._internal.helpers.coerce_callable(o: T, /) type[T]
asyncutils._internal.helpers.copy_and_clear[T: asyncutils._internal.prots.CanClearAndCopy[Any]](l: T) T[source]
asyncutils._internal.helpers.create_executor(obj: object, /, save: bool = ...) asyncutils.config.Executor[source]
asyncutils._internal.helpers.filter_out(*a: object, s: object = ...) collections.abc.Generator[Any][source]
asyncutils._internal.helpers.fullname(f: object, /, rmpref: bool = ...) str[source]
asyncutils._internal.helpers.get_loop_and_set() asyncio.AbstractEventLoop[source]
asyncutils._internal.helpers.ismodule(o: object, /) TypeGuard[types.ModuleType][source]
async asyncutils._internal.helpers.simple_wrap[T](aw: collections.abc.Awaitable[T], /) T[source]
asyncutils._internal.helpers.subscriptable[T: type](cls: T, /) T[source]
asyncutils._internal.helpers.verify_compat(version: str, /) None[source]