mypy
mypy copied to clipboard
Optional static typing for Python
**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...
#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/
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...
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`.ยด...
**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...
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...
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...