typing.no_type_check()

@typing.no_type_check(arg) Decorator to indicate that annotations are not type hints. The argument must be a class or function; if it is a class, it applies recursively to all methods defined in that class (but not to methods defined in its superclasses or subclasses). This mutates the function(s) in place.

typing.NamedTuple()

typing.NamedTuple(typename, fields) Typed version of namedtuple. Usage: Employee = typing.NamedTuple('Employee', [('name', str), ('id', int)]) This is equivalent to: Employee = collections.namedtuple('Employee', ['name', 'id']) The resulting class has one extra attribute: _field_types, giving a dict mapping field names to types. (The field names are in the _fields attribute, which is part of the namedtuple API.)

typing.MutableSet

class typing.MutableSet(AbstractSet[T]) A generic version of collections.abc.MutableSet.

typing.MutableSequence

class typing.MutableSequence(Sequence[T]) A generic version of collections.abc.MutableSequence.

typing.MutableMapping

class typing.MutableMapping(Mapping[KT, VT]) A generic version of collections.abc.MutableMapping.

typing.MappingView

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

typing.Mapping

class typing.Mapping(Sized, Iterable[KT], Container[KT], Generic[VT_co]) A generic version of collections.abc.Mapping.

typing.List

class typing.List(list, MutableSequence[T]) Generic version of list. Useful for annotating return types. To annotate arguments it is preferred to use abstract collection types such as Mapping, Sequence, or AbstractSet. This type may be used as follows: T = TypeVar('T', int, float) def vec2(x: T, y: T) -> List[T]: return [x, y] def keep_positives(vector: Sequence[T]) -> List[T]: return [item for item in vector if item > 0]

typing.KeysView

class typing.KeysView(MappingView[KT_co], AbstractSet[KT_co]) A generic version of collections.abc.KeysView.

typing.Iterator

class typing.Iterator(Iterable[T_co]) A generic version of the collections.abc.Iterator.