Skip to main content

internal.types.union

Standard library Module View source
class Union
@extend
class Union[TU]
Special methods 5
__getattr__
__getattr__[member: Literal[str]](self: Self)
__call__
__call__(self: Self, *args, **kwargs)
__iter__
@__generated__
__iter__(union)

Acquire the active iterator before lazily adapting its elements.

The concrete __iter__ runs at iter(union), not at the first next(), preserving
acquisition side effects and exceptions. A non-iterable alternative raises
only when its tag is active; it does not invalidate other alternatives.
Yield the shared element type, or a union of element types when they differ,
so heterogeneous iterable alternatives remain usable in ordinary loops.
__repr_default__
__repr_default__(self: Self) -> str
__format__
__format__(self: Self, format_spec: str) -> str