Computed types for Python — PEP 827 implementation (fork of vercel/python-typemap)
Project description
Type Manipulation in Python
[!NOTE] This is iliyasone's fork of vercel/python-typemap, published on PyPI as
python-typemap(the modules it installs keep their upstream names,typemapandtypemap_extensions). It tracks upstreammainplus one change: method annotations are skipped when collectingAttrs. Apache-2.0, same as upstream.
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
- Clone the repo
$ cd typemap$ uv sync$ 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>
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file python_typemap-0.1.0.tar.gz.
File metadata
- Download URL: python_typemap-0.1.0.tar.gz
- Upload date:
- Size: 63.4 kB
- Tags: Source
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b7e76e48ece15b63e8bcda63792f37ac647d927f6f0d3ae74a9bc61e1e54fdf
|
|
| MD5 |
ad4eef7aba1fc53732deae762a6ba0ac
|
|
| BLAKE2b-256 |
6ff0c7f9653a5feeea7aec6afbba25332a8a81782cb74f13c972237ec368ab0f
|
File details
Details for the file python_typemap-0.1.0-py3-none-any.whl.
File metadata
- Download URL: python_typemap-0.1.0-py3-none-any.whl
- Upload date:
- Size: 36.6 kB
- Tags: Python 3
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f5e9e0a3feae37fcbacb6a4ac23b02bb4393adf0caa0fb4f0fdd29aa7fe33b5
|
|
| MD5 |
f57151954ad633d96dcbccd26856e33d
|
|
| BLAKE2b-256 |
ba09d9cb55844514f40fd0290f0b7a0691d8db5e5808c50032a9b9ab95c4385d
|