mypy icon indicating copy to clipboard operation
mypy copied to clipboard

Optional static typing for Python

Results 1055 mypy issues
Sort by recently updated
recently updated
newest added

**Bug Report** When `args` is a `Union` of two or more fixed-length `Tuple`s, and `some_func()` is callable, the following call is _always_ accepted without error (regardless of what's in the...

bug

#16506 This Pull request makes it obvious that function calls in type annotations are not allowed and gets rid of the previous misleading error that the function called should be...

Document support for PEP 696: https://peps.python.org/pep-0696/

documentation
topic-pep-696

I have some proxy objects and it's difficult to type them, I want to lie to mypy what the bases are ```py from typing import TYPE_CHECKING class A: ... class...

feature
priority-2-low
semantic-analyzer
topic-ternary-expression

Document `TypeIs` in `type_narrowing.rst`.

documentation

Iterating through a fixed `Tuple` of strings `("foo", "bar")` makes the loop variable a `str` instead of `Union[Literal["foo"], Literal["bar"]]`. This makes it difficult to loop through indices of a `TypedDict`.ยด...

feature
topic-typed-dict
priority-2-low
topic-literal-types

**Bug Report** Using a typevar bound to a class that has a self returning method leads to an error when using in a function that operates on the typevar and...

bug

Implements #17152 Fixes #17149 ### Summary This PR adds to mypy the ability to recognize conditions like `if None in [a, b, c]:` and refine the types of `a, b,...

Following the [bug report](https://github.com/python/mypy/issues/17149), when checking if multiple variables are not None using the syntax `None in ` mypy should be able to refine the types of these variables to...

feature

When checking if multiple variables are not None using the syntax `None in [a, b, c]`, mypy fails to refine the types of these variables to non-Optional types after this...

bug
topic-type-narrowing