Skip to content

types

Classes:

Attributes:

AnyContextManagerCallable module-attribute

AnyContextManagerCallable = Callable[
    P,
    AbstractContextManager[R]
    | AbstractAsyncContextManager[R],
]

A callable that returns any kind of context manager.

AsyncContextManagerCallable module-attribute

AsyncContextManagerCallable = Callable[
    P, AbstractAsyncContextManager[R]
]

A callable that returns an async context manager.

AsyncIteratorCallable module-attribute

AsyncIteratorCallable = Callable[P, AsyncIterator[R]]

A callable that returns an async iterator.

ContextManagerCallable module-attribute

ContextManagerCallable = Callable[
    P, AbstractContextManager[R]
]

A callable that returns a context manager.

Hint module-attribute

Hint = type | Any

A type hint.

HintDict module-attribute

HintDict = dict[str, Hint]

A dictionary of parameter or attribute names to their type.

HintMap module-attribute

HintMap = Mapping[str, Hint]

A mapping of parameter or attribute names to their type.

HintSeq module-attribute

HintSeq = Sequence[Hint]

A sequence of types.

InferHint module-attribute

InferHint = Callable[..., Hint]

A callable that infers a type hint.

IteratorCallable module-attribute

IteratorCallable = Callable[P, Iterator[R]]

A callable that returns an iterator.

InjectionError

Bases: RuntimeError

An error raised when an injection fails.

SolutionError

Bases: RuntimeError

An error raised when a solution fails.