Skip to main content

Backports Python Typing Stubs

Project description

unpy

Backports Python 3.13 typing stubs to earlier Python versions

unpy - PyPI unpy - Python Versions unpy - license

unpy - CI unpy - pre-commit unpy - basedpyright unpy - ruff


[!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 and object type-parameter bounds
  • Replace Any type-parameter defaults with the upper-bound or object
  • Replace collections.abc and typing imports with typing_extensions backports.
  • Add additional typing[_extensions] imports for e.g. TypeVar and TypeAlias.
  • 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 and Protocol
  • Backport PEP-695 generic functions
  • Transform PEP-696 T = {} type param defaults to TypeVar("T", default={}).
  • Rename / de-duplicate typevar-like definitions
  • Infer variance of (all) Generic and Protocol type params (currently infer_variance=True is used if there's no {}_co or {}_contra suffix)
  • Transform *Ts to Unpack[Ts] (TypeVarTuple)
  • Transform **Tss to Tss (ParamSpec)
  • Reuse e.g. import typing or import typing as tp if present
  • Detect re-exported imports from typing or typing_extensions of other modules

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

unpy-0.2.0.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

unpy-0.2.0-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

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

Hashes for unpy-0.2.0.tar.gz
Algorithm Hash digest
SHA256 5623fda7425c67ece52be5c8796ab8caaeaa56840f568c81d4c6d1547a2da1b8
MD5 9e22cb7197d18ba687cfe4e05df7891b
BLAKE2b-256 8beb8e703f7ae0bf35b8fb84ec81368fbdd45420eef6221b08c83ef965199bf7

See more details on using hashes here.

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

Hashes for unpy-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cb6c2731bd947d43048c5675a7baae5eb64b3537fff271480dfbf276cb07b0a0
MD5 b3734221600692e9f9b4f61d92d2d190
BLAKE2b-256 9e117eb0cd5025e4022042f42ce3599e97714a4f10d34741a42dcba87e7db511

See more details on using hashes here.

Supported by

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