Skip to main content

Type Manipulation in Python

This is the development repository for PEP 827 – Type Manipulation, which proposes TypeScript-inspired type-level introspection and construction facilities for the Python type system.

This repository contains an implementation of the proposed additions to typing (typemap/typing.py), exported as the module typemap_extensions.

It also contains a prototype runtime evaluator (typemap/type_eval).

Discussion of the PEP is at the PEP 827 discussion thread.

A prototype typechecker implementation lives at https://github.com/msullivan/mypy-typemap and is a test dependency of this repo.

There is an example repo with a straightforward skeleton for playing around with the proposal.

Development

  1. Clone the repo
  2. $ cd typemap
  3. $ uv sync
  4. $ uv run pytest

Running the typechecker

The prototype mypy can be run from this repo with uv run mypy. Stubs are set up so that importing typemap_extensions will do the right thing.

uv run pytest tests/test_mypy_proto.py will run the mypy prototype against a supported subset of test files.

You can also run the prototype mypy directly on a file with uv run mypy <file>

Metadata

Release files for python-typemap 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 python-typemap 0.1.0
File Size Uploaded
python_typemap-0.1.0.tar.gz 63.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for python-typemap 0.1.0
File Interpreter ABI Platform
python_typemap-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 100.0 kB

Release files / python_typemap-0.1.0.tar.gz

Download URL python_typemap-0.1.0.tar.gz
Size 63.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9b7e76e48ece15b63e8bcda63792f37ac647d927f6f0d3ae74a9bc61e1e54fdf
BLAKE2b-256 checksum
How to use checksums
6ff0c7f9653a5feeea7aec6afbba25332a8a81782cb74f13c972237ec368ab0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / python_typemap-0.1.0-py3-none-any.whl

Download URL python_typemap-0.1.0-py3-none-any.whl
Size 36.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7f5e9e0a3feae37fcbacb6a4ac23b02bb4393adf0caa0fb4f0fdd29aa7fe33b5
BLAKE2b-256 checksum
How to use checksums
ba09d9cb55844514f40fd0290f0b7a0691d8db5e5808c50032a9b9ab95c4385d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

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