internal.types.union
class Union[TU]
Extends
internal.core.Union · View complete class API →
Special methods
5
__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.