typing icon indicating copy to clipboard operation
typing copied to clipboard

Python static typing home. Hosts the documentation and a user help forum.

Results 224 typing issues
Sort by recently updated
recently updated
newest added

I have been frequently using positive and negative infinity as default values for values that should otherwise be `int`s. Because of Python's duck typing this is a convenient pattern that...

topic: feature

There are existing classes that extend things in an abstract way, like ABCs, and things that are `Generic` in theory but not in reality, for example all the `collections` (the...

topic: feature

It would be useful to be able to apply type transformations to `TypeVarTuple`'s types. Some motivating examples: ```python Ts = TypeVarTuple('Ts') class Example(Generic[*Ts]): def __init__(self, *types: *type[Ts]) -> None: self.types...

topic: feature

The documentation (`typing`, PEP 526, PEP 591, PEP 593) is silent on how `Annotated` and `ClassVar`/`Final` should be nested. Intuitively, `Annotated` should appear on the outside, as the annotation applies...

topic: documentation

the same way we now have [`TypedDict`](https://www.python.org/dev/peps/pep-0589/), it would be nice to have typed SimpleNamespace with equivalent semantics, so that nested structures can be easily checked. eg ```py class MySubType(TypedSimpleNamespace):...

topic: feature

Hi. I'm just curious why passing arguments to `TypeDict` is strictly constrained. I tried some variants including positional arguments style and failed. It's not reflected in docs or function signature...

topic: documentation

Currently, we have `str` and `LiteralStr`. These don't do a good job expressing the range of values a string may have. Let's say we have the following function: ```python Email:...

topic: feature

* Built-in generics * New union syntax * No union return types, use `Any` or `T | Any` * Discuss `Any` vs `object` * Callbacks: Use return type `object` instead...

topic: documentation

### Consider this case: ```py import asyncio from typing import Any, Coroutine, Generic, TypeVar from httpx import AsyncClient, Client, Response ClientT = TypeVar("ClientT", bound=Client | AsyncClient) class API(Generic[ClientT]): client: ClientT...

topic: feature

I've found a case where a `Callable` is not allowed when used directly, but is allowed if used as an alias ```python from typing import TypeVar, Callable T = TypeVar('T')...

topic: documentation