Skip to main content

typing-compat

Python typing compatibility library


In Python >=3.8 the typing.get_origin and typing.get_args functions are provided. This library aims to bring the identical behaviour of these functions to other versions of Python.

Getting started

pip install typing-compat

Usage

>>> from typing import List, Tuple, TypeVar
>>> from typing_compat import get_args, get_origin
>>> T = TypeVar('T')

>>> tp = List[Tuple[T, T]][int]

>>> get_args(tp)
(typing.Tuple[int, int],)

>>> get_origin(tp)
<class 'list'>

License

This library is licensed under either of

at your option.

Metadata

Release files for typing-compat 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for typing-compat 0.1.0
File Size Uploaded
typing-compat-0.1.0.tar.gz 3.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for typing-compat 0.1.0
File Interpreter ABI Platform
typing_compat-0.1.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 11.4 kB

Release files / typing-compat-0.1.0.tar.gz

Download URL typing-compat-0.1.0.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a7159db80406de342bc128ab315fae3afe1ddc87cbc2df7a023763090fdfe5d2
BLAKE2b-256 checksum
How to use checksums
c8f347e8f5d02b190aa1d47ad0311f55873121b7a0728c30423ce56bf790232c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6

Release files / typing_compat-0.1.0-py2.py3-none-any.whl

Download URL typing_compat-0.1.0-py2.py3-none-any.whl
Size 7.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
a8b94eb34c95982fbd34b8daa46fd78c43db33c075b98c79b6e1d77e8f7dd4d5
BLAKE2b-256 checksum
How to use checksums
ca38837105d59d0b72eebf843dee6eda0c084aba4b6b4f64dd0251435eb86930
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page