typingplus
An enhanced version of the Python typing library that always uses the latest version of typing available, regardless of which version of Python is in use.
Installation
Install it using pip:
pip install typingplus
Features
- Contains all of the typing library, and is guaranteed to use the latest installed version of the
typinglibrary, even if the version of Python in use has an older version oftyping. typing_extensionsis integrated to be as compatible with the future of thetypingmodule as possible.- Support for comment type hints.
- A functional cast function, including to the abstract types defined in the
typingmodule. - An is_instance function that works with the abstract types defined in the
typingmodule. - An upgrade_typing function that will replace the stdlib version of
typingwith the latest version from either the stdlib or the backport.
Usage
See PEP 484.