Backports Python Typing Stubs
Project description
unpy
Backports Python 3.13 typing stubs to earlier Python versions
[!IMPORTANT] This project is in the early stages of development; You probably shouldn't use it in production.
Installation
The unpy
package is available as on PyPI, and can be installed with e.g.
pip install unpy
Usage
Usage: unpy [OPTIONS] FILE_IN [FILE_OUT]
Arguments:
FILE_IN [required]
[FILE_OUT] [default: -]
Options:
--install-completion [bash|zsh|fish|powershell|pwsh]
Install completion for the specified shell.
--show-completion [bash|zsh|fish|powershell|pwsh]
Show completion for the specified shell, to
copy it or customize the installation.
--help
Features / Wishlist
- Remove redundant
Any
andobject
type-parameter bounds - Replace
Any
type-parameter defaults with the upper-bound orobject
- Replace
collections.abc
andtyping
imports withtyping_extensions
backports. - Add additional
typing[_extensions]
imports for e.g.TypeVar
andTypeAlias
. - Backport PEP-695
type {}
aliases to{}: TypeAlias
(or use{} = TypeAliasType('{}', ...)
) if the LHS and RHS order differs). - Backport PEP-695 classes and protocols to
Generic
andProtocol
- Backport PEP-695 generic functions
- Transform PEP-696
T = {}
type param defaults toTypeVar("T", default={})
. - Rename / de-duplicate typevar-like definitions
- Infer variance of (all)
Generic
andProtocol
type params (currentlyinfer_variance=True
is used if there's no{}_co
or{}_contra
suffix) - Transform
*Ts
toUnpack[Ts]
(TypeVarTuple
) - Transform
**Tss
toTss
(ParamSpec
) - Reuse e.g.
import typing
orimport typing as tp
if present - Detect re-exported imports from
typing
ortyping_extensions
of other modules
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
unpy-0.2.0.tar.gz
(9.8 kB
view hashes)
Built Distribution
unpy-0.2.0-py3-none-any.whl
(10.4 kB
view hashes)