typing
typing copied to clipboard
Python static typing home. Hosts the documentation and a user help forum.
Create PEP for Map with bind: match Tuple of parameterized types with parameters from TypeVarTuple
Prior work in PEP-646 on Map was dropped to simplify it, with a promise it would appear in a future PEP. Here is a reference to the dropped Map feature:...
Never was added without a PEP as a way to directly indicate that something is uninhabited in 3.11 This brings up something from where we now have a way to...
Hello. I would like to revive the discussion about Callable type aliases. The original discussion is [here](https://github.com/python/mypy/issues/1641), and the related discussion about `@declared_type` is [here](https://github.com/python/mypy/issues/2087) and [here](https://github.com/python/mypy/pull/3291). The original thread...
range typing
I suggest you add Range, Min, and Max typing to check if a number is inside a range or something like that. ```py def example(range_example: Range(int, 1, 5), min_example: Min(int,...
I'd like to have a family of classes where overrides have additional parameters to various methods: ```python from typing import Generic, Unpack from typing_extensions import TypedDict, TypeVar, override class EmptyDict(TypedDict,...
I think the ability of indicating that a typed dict requires all keys or that all are optional would be very useful. For example to allow defining default values for...
I wasn't aware there were discrepancies between type checkers about this. Coming from https://github.com/microsoft/pyright/issues/5830, [PEP 718](https://peps.python.org/pep-0718) will require documentation about specialisation for functions and [PEP 696](https://peps.python.org/pep-0696) requires documentation about whether...
I'm wondering how is the relation between the following PEPs: - [PEP 584](https://peps.python.org/pep-0584/) which introduces operator `|` for dicts, but doesn't mention how it should behave for `TypedDict`. - [PEP...
[PEP 561](https://peps.python.org/pep-0561/) currently states the following: > Package maintainers who wish to support type checking of their code MUST add a marker file named `py.typed` to their package supporting typing....
Summary --- Please consider a new typing keyword that stands in for the top level type of a corresponding type variable. Motivation --- Consider a test [here](https://github.com/NeilGirdhar/efax/blob/118b3e1f39dd0cdd99f4fe19b13c666b27a4236f/tests/test_flatten.py) and the corresponding...