loongson/pypi/: typing-extensions-4.3.0 metadata and description
Backported and Experimental Type Hints for Python 3.7+
| author_email | "Guido van Rossum, Jukka Lehtosalo, Ćukasz Langa, Michael Lee" <levkivskyi@gmail.com> |
| classifiers |
|
| description_content_type | text/markdown |
| keywords | annotations,backport,checker,checking,function,hinting,hints,type,typechecking,typehinting,typehints,typing |
| project_urls |
|
| requires_python | >=3.7 |
| File | Tox results | History |
|---|---|---|
typing_extensions-4.3.0-py3-none-any.whl
|
|
Typing Extensions
Overview
The typing_extensions module serves two related purposes:
- Enable use of new type system features on older Python versions. For example,
typing.TypeGuardis new in Python 3.10, buttyping_extensionsallows users on Python 3.6 through 3.9 to use it too. - Enable experimentation with new type system PEPs before they are accepted and
added to the
typingmodule.
New features may be added to typing_extensions as soon as they are specified
in a PEP that has been added to the python/peps
repository. If the PEP is accepted, the feature will then be added to typing
for the next CPython release. No typing PEP has been rejected so far, so we
haven't yet figured out how to deal with that possibility.
Starting with version 4.0.0, typing_extensions uses
Semantic Versioning. The
major version is incremented for all backwards-incompatible changes.
Therefore, it's safe to depend
on typing_extensions like this: typing_extensions >=x.y, <(x+1),
where x.y is the first version that includes all features you need.
typing_extensions supports Python versions 3.7 and higher. In the future,
support for older Python versions will be dropped some time after that version
reaches end of life.
Included items
This module currently contains the following:
-
Experimental features
- (Currently none)
-
In
typingsince Python 3.11assert_neverassert_typeclear_overloads@dataclass_transform()(see PEP 681)get_overloadsLiteralString(see PEP 675)NeverNotRequired(see PEP 655)reveal_typeRequired(see PEP 655)Self(see PEP 673)TypeVarTuple(see PEP 646)Unpack(see PEP 646)
-
In
typingsince Python 3.10Concatenate(see PEP 612)ParamSpec(see PEP 612)ParamSpecArgs(see PEP 612)ParamSpecKwargs(see PEP 612)TypeAlias(see PEP 613)TypeGuard(see PEP 647)is_typeddict
-
In
typingsince Python 3.9Annotated(see PEP 593)
-
In
typingsince Python 3.8final(see PEP 591)Final(see PEP 591)Literal(see PEP 586)Protocol(see PEP 544)runtime_checkable(see PEP 544)TypedDict(see PEP 589)get_origin(typing_extensionsprovides this function only in Python 3.7+)get_args(typing_extensionsprovides this function only in Python 3.7+)
-
In
typingsince Python 3.7OrderedDict
-
In
typingsince Python 3.5 or 3.6 (see the typing documentation for details)AsyncContextManagerAsyncGeneratorAsyncIterableAsyncIteratorAwaitableChainMapClassVar(see PEP 526)ContextManagerCoroutineCounterDefaultDictDequeNamedTupleNewTypeNoReturnoverloadTextTypeTYPE_CHECKINGget_type_hints
Other Notes and Limitations
Certain objects were changed after they were added to typing, and
typing_extensions provides a backport even on newer Python versions:
TypedDictdoes not store runtime information about which (if any) keys are non-required in Python 3.8, and does not honor thetotalkeyword with old-styleTypedDict()in Python 3.9.0 and 3.9.1.TypedDictalso does not support multiple inheritance withtyping.Genericon Python <3.11.get_originandget_argslack support forAnnotatedin Python 3.8 and lack support forParamSpecArgsandParamSpecKwargsin 3.9.@finalwas changed in Python 3.11 to set the.__final__attribute.@overloadwas changed in Python 3.11 to make function overloads introspectable at runtime. In order to access overloads withtyping_extensions.get_overloads(), you must use@typing_extensions.overload.NamedTuplewas changed in Python 3.11 to allow for multiple inheritance withtyping.Generic.
There are a few types whose interface was modified between different
versions of typing. For example, typing.Sequence was modified to
subclass typing.Reversible as of Python 3.5.3.
These changes are not backported to prevent subtle compatibility issues when mixing the differing implementations of modified classes.
Certain types have incorrect runtime behavior due to limitations of older versions of the typing module:
ParamSpecandConcatenatewill not work withget_argsandget_origin. Certain PEP 612 special cases in user-definedGenerics are also not available.
These types are only guaranteed to work for static type checking.
Running tests
To run tests, navigate into the appropriate source directory and run
test_typing_extensions.py.