bagof.hints.typevars.infer
TypeVars with inferred variance.
These are declared with infer_variance=True, so the variance
is not fixed up front: the type checker derives it for each generic class
separately, from how the class actually uses the parameter. That makes a
single TypeVar reusable across classes that would otherwise need the
covariant, contravariant and invariant flavours.
Variance is only ever inferred per generic class or protocol definition; it says nothing about the TypeVar in isolation.
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 inferred-variance TypeVar for hashable objects (with a compact name).
T
module-attribute
An inferred-variance TypeVar (with a compact name).
OBJECT
module-attribute
An inferred-variance TypeVar for objects.
TYPE
module-attribute
An inferred-variance TypeVar for types.
NONE
module-attribute
An inferred-variance TypeVar for None values.
STR
module-attribute
An inferred-variance TypeVar for strings.
BYTES
module-attribute
An inferred-variance TypeVar for bytes.
BOOL
module-attribute
An inferred-variance TypeVar for booleans.
INT
module-attribute
An inferred-variance TypeVar for (builtin) ints.
FLOAT
module-attribute
An inferred-variance TypeVar for (builtin) floats.
COMPLEX
module-attribute
An inferred-variance TypeVar for (builtin) complex numbers.
INTEGRAL
module-attribute
An inferred-variance TypeVar for integral numbers.
REAL
module-attribute
An inferred-variance TypeVar for real numbers.
NUMBER
module-attribute
An inferred-variance TypeVar for numeric values.
CONTAINER
module-attribute
An inferred-variance TypeVar for containers.
HASHABLE
module-attribute
An inferred-variance TypeVar for hashable objects.
ITERABLE
module-attribute
An inferred-variance TypeVar for iterables.
ITERATOR
module-attribute
An inferred-variance TypeVar for iterators.
REVERSIBLE
module-attribute
An inferred-variance TypeVar for reversibles.
GENERATOR
module-attribute
GENERATOR = tx.TypeVar('GENERATOR', infer_variance=True, bound=tx.Generator[tx.Any, tx.Any, tx.Any])
An inferred-variance TypeVar for generators.
SIZED
module-attribute
An inferred-variance TypeVar for sized objects.
COLLECTION
module-attribute
An inferred-variance TypeVar for collections.
SEQUENCE
module-attribute
An inferred-variance TypeVar for sequences.
MUTABLE_SEQUENCE
module-attribute
MUTABLE_SEQUENCE = tx.TypeVar('MUTABLE_SEQUENCE', infer_variance=True, bound=tx.MutableSequence[tx.Any])
An inferred-variance TypeVar for mutable sequences.
SET
module-attribute
An inferred-variance TypeVar for sets.
MUTABLE_SET
module-attribute
An inferred-variance TypeVar for mutable sets.
MAPPING
module-attribute
An inferred-variance TypeVar for mappings.
MUTABLE_MAPPING
module-attribute
MUTABLE_MAPPING = tx.TypeVar('MUTABLE_MAPPING', infer_variance=True, bound=tx.MutableMapping[tx.Any, tx.Any])
An inferred-variance TypeVar for mutable mappings.
AWAITABLE
module-attribute
An inferred-variance TypeVar for awaitables.
BUFFER
module-attribute
An inferred-variance TypeVar for buffers.
LIST
module-attribute
An inferred-variance TypeVar for lists.
TUPLE
module-attribute
An inferred-variance TypeVar for tuples.