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 details)
Built Distribution
unpy-0.2.0-py3-none-any.whl
(10.4 kB
view details)
File details
Details for the file unpy-0.2.0.tar.gz
.
File metadata
- Download URL: unpy-0.2.0.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5623fda7425c67ece52be5c8796ab8caaeaa56840f568c81d4c6d1547a2da1b8 |
|
MD5 | 9e22cb7197d18ba687cfe4e05df7891b |
|
BLAKE2b-256 | 8beb8e703f7ae0bf35b8fb84ec81368fbdd45420eef6221b08c83ef965199bf7 |
File details
Details for the file unpy-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: unpy-0.2.0-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb6c2731bd947d43048c5675a7baae5eb64b3537fff271480dfbf276cb07b0a0 |
|
MD5 | b3734221600692e9f9b4f61d92d2d190 |
|
BLAKE2b-256 | 9e117eb0cd5025e4022042f42ce3599e97714a4f10d34741a42dcba87e7db511 |