typing-extensions

Backported and Experimental Type Hints for Python 3.9+

49 个版本 Python >=3.9
安装
pip install typing-extensions
poetry add typing-extensions
pipenv install typing-extensions
conda install typing-extensions
描述

Typing Extensions

DocumentationPyPI

Overview

The typing_extensions module serves two related purposes:

  • Enable use of new type system features on older Python versions. For example, typing.TypeGuard is new in Python 3.10, but typing_extensions allows users on previous Python versions to use it too.
  • Enable experimentation with new type system PEPs before they are accepted and added to the typing module.

typing_extensions is treated specially by static type checkers such as mypy and pyright. Objects defined in typing_extensions are treated the same way as equivalent forms in typing.

typing_extensions uses Semantic Versioning. The major version will be incremented only for backwards-incompatible changes. Therefore, it's safe to depend on typing_extensions like this: typing_extensions ~=x.y, where x.y is the first version that includes all features you need. This is equivalent to typing_extensions >=x.y, <(x+1). Do not depend on ~= x.y.z unless you really know what you're doing; that defeats the purpose of semantic versioning.

Included items

See the documentation for a complete listing of module contents.

Contributing

See CONTRIBUTING.md for how to contribute to typing_extensions.

版本列表
4.15.0 2025-08-25
4.15.0rc1 2025-08-18
4.14.1 2025-07-04
4.14.0 2025-06-02
4.14.0rc1 2025-05-24
4.13.2 2025-04-10
4.13.1 2025-04-03
4.13.0 2025-03-26
4.13.0rc1 2025-03-18
4.12.2 2024-06-07
4.12.1 2024-06-01
4.12.0 2024-05-24
4.12.0rc1 2024-05-16
4.12.0a2 2024-05-16
4.11.0 2024-04-05
4.11.0rc1 2024-03-24
4.10.0 2024-02-25
4.10.0rc1 2024-02-18
4.9.0 2023-12-10
4.9.0rc1 2023-11-29
4.8.0 2023-09-18
4.8.0rc1 2023-09-08
4.7.1 2023-07-02
4.7.0 2023-06-28
4.7.0rc1 2023-06-21
4.6.3 2023-06-01
4.6.2 2023-05-25
4.6.1 2023-05-24
4.6.0 2023-05-23
4.5.0 2023-02-15
4.4.0 2022-10-06
4.3.0 2022-07-01
4.2.0 2022-04-17
4.1.1 2022-02-14
4.1.0 2022-02-12
4.0.1 2021-12-01
4.0.0 2021-11-14
3.10.0.2 2021-08-30
3.10.0.1 2021-08-29
3.10.0.0 2021-05-01
3.7.4.3 2020-08-23
3.7.4.2 2020-04-02
3.7.4.1 2019-10-28
3.7.4 2019-06-19
3.7.2 2019-01-12
3.6.6 2018-10-06
3.6.5 2018-05-07
3.6.2.1 2017-09-30
3.6.2 2017-09-17