typing icon indicating copy to clipboard operation
typing copied to clipboard

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

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

**Problem:** I am writing a python application, and I made a function that creates an object and passes its additional `*args` and `**kwargs` to object's constructor and takes few its...

topic: feature

The example in https://typing.python.org/en/latest/spec/literal.html#literalstring-overloads doesn't type check in pyright because the overloads overlap unsafely. (Mypy doesn't support LiteralString; I didn't try other type checkers.) Maybe the section can just be...

topic: other
topic: typing spec

There are 3 classes in `protocols_definition.py` which raise an error when instantiated. `Concrete4_Good7`, `Concrete6_Good3` and `Concrete6_Bad3`. ``` ValueError: mutable default for field val1 is not allowed: use default_factory ``` Instead...

topic: conformance tests

See https://discuss.python.org/t/interactions-with-never-leading-to-undesirable-assignability/99445/25 I feel this is a straightforward oversight so I don't think this needs to go through the full approval process.

topic: typing spec

While working on #2068 I ran the conformance test suite under Python 3.14 and got a number of changes: ```diff diff --git a/conformance/results/mypy/classes_classvar.toml b/conformance/results/mypy/classes_classvar.toml index 0072d63..ce30b65 100644 --- a/conformance/results/mypy/classes_classvar.toml +++...

topic: other

From python/typeshed#14558: Some classes (like `re.Pattern`) are not instantiable at runtime: ```python >>> import re >>> re.Pattern() Traceback (most recent call last): File "", line 1, in TypeError: cannot create...

topic: feature

The spec currently isn't very precise on the order in which type parameters appear in a class. (Given a class C that is generic over type parameters T1 and T2,...

topic: documentation
topic: typing spec

*Splitting issue from PR https://github.com/python/typing/pull/1978* Spec says that it should be generally rejected ([ref](https://typing.python.org/en/latest/spec/typeddict.html#supported-and-unsupported-operations)) > A key that is not a literal should generally be rejected, since its value is...

topic: typing spec

*Splitting issue from PR https://github.com/python/typing/pull/1978* Spec says that indexing with unknown literal keys should be reported as an error: > **The use of a key that is not known to...

topic: typing spec

I just stumbled across this paragraph: https://github.com/python/typing/blob/2d88da2a407b556f5b52b4c6ad1bd659873bb9ac/docs/spec/generics.rst?plain=1#L2540-L2544 If I understand it correctly, then the following code is fine, i.e., `Foo` is assignable to `Proto` according to the explanation: ```py from...

topic: typing spec