Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Python 3.11.3

Contenu du module « typing »

Liste des classes du module typing

Nom de la classe Description
ABCMeta Metaclass for defining Abstract Base Classes (ABCs). [extrait de ABCMeta.__doc__]
Annotated Add context specific metadata to a type. [extrait de Annotated.__doc__]
Any Special type indicating an unconstrained type. [extrait de Any.__doc__]
BinaryIO Typed version of the return of open() in binary mode. [extrait de BinaryIO.__doc__]
defaultdict defaultdict(default_factory=None, /, [...]) --> dict with default factory [extrait de defaultdict.__doc__]
ForwardRef Internal wrapper to hold a forward reference. [extrait de ForwardRef.__doc__]
Generic Abstract base class for generic types. [extrait de Generic.__doc__]
GenericAlias Represent a PEP 585 generic type [extrait de GenericAlias.__doc__]
IO Generic base class for TextIO and BinaryIO. [extrait de IO.__doc__]
NamedTupleMeta
NewType NewType creates simple unique types with almost zero [extrait de NewType.__doc__]
ParamSpec Parameter specification variable. [extrait de ParamSpec.__doc__]
ParamSpecArgs The args for a ParamSpec object. [extrait de ParamSpecArgs.__doc__]
ParamSpecKwargs The kwargs for a ParamSpec object. [extrait de ParamSpecKwargs.__doc__]
Protocol Base class for protocol classes. [extrait de Protocol.__doc__]
SupportsAbs An ABC with one abstract method __abs__ that is covariant in its return type. [extrait de SupportsAbs.__doc__]
SupportsBytes An ABC with one abstract method __bytes__. [extrait de SupportsBytes.__doc__]
SupportsComplex An ABC with one abstract method __complex__. [extrait de SupportsComplex.__doc__]
SupportsFloat An ABC with one abstract method __float__. [extrait de SupportsFloat.__doc__]
SupportsIndex An ABC with one abstract method __index__. [extrait de SupportsIndex.__doc__]
SupportsInt An ABC with one abstract method __int__. [extrait de SupportsInt.__doc__]
SupportsRound An ABC with one abstract method __round__ that is covariant in its return type. [extrait de SupportsRound.__doc__]
TextIO Typed version of the return of open() in text mode. [extrait de TextIO.__doc__]
TypeVar Type variable. [extrait de TypeVar.__doc__]
TypeVarTuple Type variable tuple. [extrait de TypeVarTuple.__doc__]

Liste des fonctions du module typing

Signature de la fonction Description
abstractmethod(funcobj) A decorator indicating abstract methods. [extrait de abstractmethod.__doc__]
AbstractSet(*args, **kwargs) A generic version of collections.abc.Set. [extrait de AbstractSet.__doc__]
assert_never(arg: Never) -> Never Statically assert that a line of code is unreachable. [extrait de assert_never.__doc__]
assert_type(val, typ) Ask a static type checker to confirm that the value is of the given type. [extrait de assert_type.__doc__]
AsyncContextManager(*args, **kwargs) A generic version of contextlib.AbstractAsyncContextManager. [extrait de AsyncContextManager.__doc__]
AsyncGenerator(*args, **kwargs) A generic version of collections.abc.AsyncGenerator. [extrait de AsyncGenerator.__doc__]
AsyncIterable(*args, **kwargs) A generic version of collections.abc.AsyncIterable. [extrait de AsyncIterable.__doc__]
AsyncIterator(*args, **kwargs) A generic version of collections.abc.AsyncIterator. [extrait de AsyncIterator.__doc__]
Awaitable(*args, **kwargs) A generic version of collections.abc.Awaitable. [extrait de Awaitable.__doc__]
ByteString(*args, **kwargs) A generic version of collections.abc.ByteString. [extrait de ByteString.__doc__]
Callable(*args, **kwargs) Callable type; Callable[[int], str] is a function of (int) -> str. [extrait de Callable.__doc__]
cast(typ, val) Cast a value to a type. [extrait de cast.__doc__]
ChainMap(*args, **kwargs) A generic version of collections.ChainMap. [extrait de ChainMap.__doc__]
ClassVar(*args, **kwds) Special type construct to mark class variables. [extrait de ClassVar.__doc__]
clear_overloads() Clear all overloads in the registry. [extrait de clear_overloads.__doc__]
Collection(*args, **kwargs) A generic version of collections.abc.Collection. [extrait de Collection.__doc__]
Concatenate(*args, **kwds) Used in conjunction with ``ParamSpec`` and ``Callable`` to represent a [extrait de Concatenate.__doc__]
Container(*args, **kwargs) A generic version of collections.abc.Container. [extrait de Container.__doc__]
ContextManager(*args, **kwargs) A generic version of contextlib.AbstractContextManager. [extrait de ContextManager.__doc__]
Coroutine(*args, **kwargs) A generic version of collections.abc.Coroutine. [extrait de Coroutine.__doc__]
Counter(*args, **kwargs) A generic version of collections.Counter. [extrait de Counter.__doc__]
dataclass_transform(*, eq_default: bool = True, order_default: bool = False, kw_only_default: bool = False, field_specifiers: tuple[typing.Union[type[typing.Any], typing.Callable[..., typing.Any]], ...] = (), **kwargs: Any) -> Callable[[~T], ~T] Decorator that marks a function, class, or metaclass as providing [extrait de dataclass_transform.__doc__]
DefaultDict(*args, **kwargs) A generic version of collections.defaultdict. [extrait de DefaultDict.__doc__]
Deque(*args, **kwargs) A generic version of collections.deque. [extrait de Deque.__doc__]
Dict(*args, **kwargs) A generic version of dict. [extrait de Dict.__doc__]
Final(*args, **kwds) Special typing construct to indicate final names to type checkers. [extrait de Final.__doc__]
final(f) A decorator to indicate final methods and final classes. [extrait de final.__doc__]
FrozenSet(*args, **kwargs) A generic version of frozenset. [extrait de FrozenSet.__doc__]
Generator(*args, **kwargs) A generic version of collections.abc.Generator. [extrait de Generator.__doc__]
get_args(tp) Get type arguments with all substitutions performed. [extrait de get_args.__doc__]
get_origin(tp) Get the unsubscripted version of a type. [extrait de get_origin.__doc__]
get_overloads(func) Return all defined overloads for *func* as a sequence. [extrait de get_overloads.__doc__]
get_type_hints(obj, globalns=None, localns=None, include_extras=False) Return type hints for an object. [extrait de get_type_hints.__doc__]
Hashable(*args, **kwargs) A generic version of collections.abc.Hashable. [extrait de Hashable.__doc__]
is_typeddict(tp) Check if an annotation is a TypedDict class [extrait de is_typeddict.__doc__]
ItemsView(*args, **kwargs) A generic version of collections.abc.ItemsView. [extrait de ItemsView.__doc__]
Iterable(*args, **kwargs) A generic version of collections.abc.Iterable. [extrait de Iterable.__doc__]
Iterator(*args, **kwargs) A generic version of collections.abc.Iterator. [extrait de Iterator.__doc__]
KeysView(*args, **kwargs) A generic version of collections.abc.KeysView. [extrait de KeysView.__doc__]
List(*args, **kwargs) A generic version of list. [extrait de List.__doc__]
Literal(*args, **kwds) Special typing form to define literal types (a.k.a. value types). [extrait de Literal.__doc__]
LiteralString(*args, **kwds) Represents an arbitrary literal string. [extrait de LiteralString.__doc__]
Mapping(*args, **kwargs) A generic version of collections.abc.Mapping. [extrait de Mapping.__doc__]
MappingView(*args, **kwargs) A generic version of collections.abc.MappingView. [extrait de MappingView.__doc__]
Match(*args, **kwargs) A generic version of re.Match. [extrait de Match.__doc__]
MutableMapping(*args, **kwargs) A generic version of collections.abc.MutableMapping. [extrait de MutableMapping.__doc__]
MutableSequence(*args, **kwargs) A generic version of collections.abc.MutableSequence. [extrait de MutableSequence.__doc__]
MutableSet(*args, **kwargs) A generic version of collections.abc.MutableSet. [extrait de MutableSet.__doc__]
NamedTuple(typename, fields=None, /, **kwargs) Typed version of namedtuple. [extrait de NamedTuple.__doc__]
Never(*args, **kwds) The bottom type, a type that has no members. [extrait de Never.__doc__]
no_type_check(arg) Decorator to indicate that annotations are not type hints. [extrait de no_type_check.__doc__]
no_type_check_decorator(decorator) Decorator to give another decorator the @no_type_check effect. [extrait de no_type_check_decorator.__doc__]
NoReturn(*args, **kwds) Special type indicating functions that never return. [extrait de NoReturn.__doc__]
NotRequired(*args, **kwds) A special typing construct to mark a key of a TypedDict as [extrait de NotRequired.__doc__]
Optional(*args, **kwds) Optional type. [extrait de Optional.__doc__]
OrderedDict(*args, **kwargs) A generic version of collections.OrderedDict. [extrait de OrderedDict.__doc__]
overload(func) Decorator for overloaded functions/methods. [extrait de overload.__doc__]
Pattern(*args, **kwargs) A generic version of re.Pattern. [extrait de Pattern.__doc__]
Required(*args, **kwds) A special typing construct to mark a key of a total=False TypedDict [extrait de Required.__doc__]
reveal_type(obj: ~T) -> ~T Reveal the inferred type of a variable. [extrait de reveal_type.__doc__]
Reversible(*args, **kwargs) A generic version of collections.abc.Reversible. [extrait de Reversible.__doc__]
runtime_checkable(cls) Mark a protocol class as a runtime protocol. [extrait de runtime_checkable.__doc__]
Self(*args, **kwds) Used to spell the type of "self" in classes. [extrait de Self.__doc__]
Sequence(*args, **kwargs) A generic version of collections.abc.Sequence. [extrait de Sequence.__doc__]
Set(*args, **kwargs) A generic version of set. [extrait de Set.__doc__]
Sized(*args, **kwargs) A generic version of collections.abc.Sized. [extrait de Sized.__doc__]
Tuple(*args, **kwargs) Tuple type; Tuple[X, Y] is the cross-product type of X and Y. [extrait de Tuple.__doc__]
Type(*args, **kwargs) A special construct usable to annotate class objects. [extrait de Type.__doc__]
TypeAlias(*args, **kwds) Special marker indicating that an assignment should [extrait de TypeAlias.__doc__]
TypedDict(typename, fields=None, /, *, total=True, **kwargs) A simple typed namespace. At runtime it is equivalent to a plain dict. [extrait de TypedDict.__doc__]
TypeGuard(*args, **kwds) Special typing form used to annotate the return type of a user-defined [extrait de TypeGuard.__doc__]
Union(*args, **kwds) Union type; Union[X, Y] means either X or Y. [extrait de Union.__doc__]
Unpack(*args, **kwds) Type unpack operator. [extrait de Unpack.__doc__]
ValuesView(*args, **kwargs) A generic version of collections.abc.ValuesView. [extrait de ValuesView.__doc__]

Liste des variables globales du module typing

Nom de la variable globale Valeur
AnyStr ~AnyStr
CT_co +CT_co
EXCLUDED_ATTRIBUTES ['__parameters__', '__orig_bases__', '__orig_class__', '_is_protocol', '_is_runtime_protocol', '__abstractmethods__', '__annotations__', '__dict__', '__doc__', '__init__', '__module__', '__new__', '__slots__', '__subclasshook__', '__weakref__', '__class_getitem__', '_MutableMapping__marker']
KT ~KT
T ~T
T_co +T_co
T_contra -T_contra
TYPE_CHECKING False
V_co +V_co
VT ~VT
VT_co +VT_co

Liste des alias du module typing

Nom de l'alias Définition ciblée
MethodDescriptorType method_descriptor
MethodWrapperType method-wrapper
Text str
WrapperDescriptorType wrapper_descriptor
io typing.io
re typing.re