Metadata-Version: 2.4
Name: python-typemap
Version: 0.1.0
Summary: Computed types for Python — PEP 827 implementation (fork of vercel/python-typemap)
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/iliyasone/python-typemap
Project-URL: Upstream, https://github.com/vercel/python-typemap
Project-URL: PEP, https://peps.python.org/pep-0827/
Requires-Python: >=3.14
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# Type Manipulation in Python

> [!NOTE]
> This is [iliyasone's fork](https://github.com/iliyasone/python-typemap) of
> [vercel/python-typemap](https://github.com/vercel/python-typemap), published on PyPI as
> [`python-typemap`](https://pypi.org/project/python-typemap/) (the modules it installs keep
> their upstream names, ``typemap`` and ``typemap_extensions``). It tracks upstream `main`
> plus one change: method annotations are skipped when collecting `Attrs`. Apache-2.0, same
> as upstream.

This is the development repository for
[PEP 827 – Type Manipulation](https://peps.python.org/pep-0827/),
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](typemap/typing.py)), exported as
the module ``typemap_extensions``.

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

Discussion of the PEP is at the
[PEP 827 discussion thread](https://discuss.python.org/t/pep-827-type-manipulation/106353).

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](https://github.com/msullivan/typemap-test)
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>`
