typing module was added to the standard library in Python 3.5 on
a provisional basis and will no longer be provisional in Python 3.7. However,
this means users of Python 3.5 - 3.6 who are unable to upgrade will not be
able to take advantage of new types added to the
typing module, such as
typing_extensions module contains both backports of these changes
as well as experimental types that will eventually be added to the
module, such as
Protocol (see PEP 544 for details about protocols and
static duck typing) or
TypedDict (see PEP 589).
Users of other Python versions should continue to install and use
typing module from PyPi instead of using this one unless
specifically writing code that must be compatible with multiple Python
versions or requires experimental types.
This module currently contains the following:
All Python versions:
overload(note that older versions of
typingonly let you use
Protocol(except on Python 3.5.0)
runtime(except on Python 3.5.0)
Python 3.3+ only:
Python 3.5+ only:
Python 3.6+ only:
Other Notes and Limitations
There are a few types whose interface was modified between different
versions of typing. For example,
typing.Sequence was modified to
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.
To run tests, navigate into the appropriate source directory and run
test_typing_extensions.py. You will also need to install the latest
typing if you are using a version of Python that does not
typing as a part of the standard library.