bagof.hints.typevars.inv
Invariant TypeVars.
An invariant parameter ignores the subtype relation of its argument:
even though bool is a subtype of int, Box[bool] is neither usable
where Box[int] is expected nor the other way round. This is the only
sound variance when the parameter appears in both input and output
positions, as it does for anything mutable.
Invariance is the default for tx.TypeVar, so these are
declared without a variance keyword.
Every TypeVar here carries an upper bound (not a set of value constraints), so it can be solved for any subtype of that bound, and never for an unrelated type.
Attributes
K
module-attribute
An invariant TypeVar for hashable objects (with a compact name).
OBJECT
module-attribute
An invariant TypeVar for objects.
NONE
module-attribute
An invariant TypeVar for None values.
FLOAT
module-attribute
An invariant TypeVar for (builtin) floats.
COMPLEX
module-attribute
An invariant TypeVar for (builtin) complex numbers.
INTEGRAL
module-attribute
An invariant TypeVar for integral numbers.
REAL
module-attribute
An invariant TypeVar for real numbers.
NUMBER
module-attribute
An invariant TypeVar for numeric values.
CONTAINER
module-attribute
An invariant TypeVar for containers.
HASHABLE
module-attribute
An invariant TypeVar for hashable objects.
ITERABLE
module-attribute
An invariant TypeVar for iterables.
ITERATOR
module-attribute
An invariant TypeVar for iterators.
REVERSIBLE
module-attribute
An invariant TypeVar for reversibles.
GENERATOR
module-attribute
An invariant TypeVar for generators.
SIZED
module-attribute
An invariant TypeVar for sized objects.
COLLECTION
module-attribute
An invariant TypeVar for collections.
SEQUENCE
module-attribute
An invariant TypeVar for sequences.
MUTABLE_SEQUENCE
module-attribute
An invariant TypeVar for mutable sequences.
MUTABLE_SET
module-attribute
An invariant TypeVar for mutable sets.
MAPPING
module-attribute
An invariant TypeVar for mappings.
MUTABLE_MAPPING
module-attribute
An invariant TypeVar for mutable mappings.
AWAITABLE
module-attribute
An invariant TypeVar for awaitables.
BUFFER
module-attribute
An invariant TypeVar for buffers.
LIST
module-attribute
An invariant TypeVar for lists.
TUPLE
module-attribute
An invariant TypeVar for tuples.