gituser/docker_multiarch/: typing-compat-0.1.0 metadata and description

Homepage Simple index

Python typing compatibility library

author Ross MacArthur
author_email ross@macarthur.io
classifiers
  • Development Status :: 3 - Alpha
  • License :: OSI Approved :: Apache Software License
  • License :: OSI Approved :: MIT License
  • Natural Language :: English
  • Programming Language :: Python
  • Programming Language :: Python :: 2
  • Programming Language :: Python :: 2.7
  • Programming Language :: Python :: 3
  • Programming Language :: Python :: 3.5
  • Programming Language :: Python :: 3.6
  • Programming Language :: Python :: 3.7
  • Programming Language :: Python :: 3.8
  • Programming Language :: Python :: Implementation :: CPython
  • Programming Language :: Python :: Implementation :: PyPy
description_content_type text/markdown
download_url https://github.com/rossmacarthur/typing-compat/archive/0.1.0.tar.gz
project_urls
  • Issue Tracker, https://github.com/rossmacarthur/typing-compat/issues
requires_dist
  • typing ; python_version < "3.5"
requires_python >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*
File Tox results History
typing_compat-0.1.0-py2.py3-none-any.whl
Size
8 KB
Type
Python Wheel
Python
2.7

typing-compat

Python typing compatibility library

Build status Code style: black

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.