Skip to main content

Like `typing._eval_type`, but lets older Python versions use newer typing features.

Project description

eval_type_backport

Build Status Coverage Status Supports Python versions 3.7+, including PyPy Anaconda's conda-forge channel

This is a tiny package providing a replacement for typing._eval_type to support newer typing features in older Python versions.

Yes, that's very specific, and yes, typing._eval_type is a protected function that you shouldn't normally be using. Really this package is specifically made for https://github.com/pydantic/pydantic/issues/7873.

Specifically, this transforms X | Y into typing.Union[X, Y] and list[X] into typing.List[X] etc. (for all the types made generic in PEP 585) if the original syntax is not supported in the current Python version.

Install

From PyPI:

pip install eval-type-backport

or with Conda:

conda install -c conda-forge eval-type-backport

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eval_type_backport-0.3.1.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eval_type_backport-0.3.1-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file eval_type_backport-0.3.1.tar.gz.

File metadata

  • Download URL: eval_type_backport-0.3.1.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.19

File hashes

Hashes for eval_type_backport-0.3.1.tar.gz
Algorithm Hash digest
SHA256 57e993f7b5b69d271e37482e62f74e76a0276c82490cf8e4f0dffeb6b332d5ed
MD5 d59c6ef4c2b96436c4fbad53a5f40c9f
BLAKE2b-256 fba3cafafb4558fd638aadfe4121dc6cefb8d743368c085acb2f521df0f3d9d7

See more details on using hashes here.

File details

Details for the file eval_type_backport-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for eval_type_backport-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 279ab641905e9f11129f56a8a78f493518515b83402b860f6f06dd7c011fdfa8
MD5 9ebf51e6e83a56eb6db7b1214f93dfb9
BLAKE2b-256 cf22fdc2e30d43ff853720042fa15baa3e6122722be1a7950a98233ebb55cd71

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page