typing.Tuple

class typing.Tuple Tuple type; Tuple[X, Y] is the type of a tuple of two items with the first item of type X and the second of type Y. Example: Tuple[T1, T2] is a tuple of two elements corresponding to type variables T1 and T2. Tuple[int, float, str] is a tuple of an int, a float and a string. To specify a variable-length tuple of homogeneous type, use literal ellipsis, e.g. Tuple[int, ...].

typing.SupportsFloat

class typing.SupportsFloat An ABC with one abstract method __float__.

typing.TypeVar

class typing.TypeVar Type variable. Usage: T = TypeVar('T') # Can be anything A = TypeVar('A', str, bytes) # Must be str or bytes Type variables exist primarily for the benefit of static type checkers. They serve as the parameters for generic types as well as for generic function definitions. See class Generic for more information on generic types. Generic functions work as follows: def repeat(x: T, n: int) -> Sequence[T]: """Return a list containing n references to x.""" retur

typing.SupportsAbs

class typing.SupportsAbs An ABC with one abstract method __abs__ that is covariant in its return type.

typing.re

class typing.re Wrapper namespace for regular expression matching types. This defines the type aliases Pattern and Match which correspond to the return types from re.compile() and re.match(). These types (and the corresponding functions) are generic in AnyStr and can be made specific by writing Pattern[str], Pattern[bytes], Match[str], or Match[bytes].

typing.Reversible

class typing.Reversible An ABC with one abstract method __reversed__ returning an Iterator[T_co].

typing.Set

class typing.Set(set, MutableSet[T]) A generic version of builtins.set.

typing.Optional

class typing.Optional Optional type. Optional[X] is equivalent to Union[X, type(None)]. Note that this is not the same concept as an optional argument, which is one that has a default. An optional argument with a default needn’t use the Optional qualifier on its type annotation (although it is inferred if the default is None). A mandatory argument may still have an Optional type if an explicit value of None is allowed.

typing.Sequence

class typing.Sequence(Sized, Iterable[T_co], Container[T_co]) A generic version of collections.abc.Sequence.

typing.no_type_check_decorator()

@typing.no_type_check_decorator(decorator) Decorator to give another decorator the no_type_check() effect. This wraps the decorator with something that wraps the decorated function in no_type_check().