mypy
mypy copied to clipboard
Optional static typing for Python
Followup to https://github.com/python/mypy/pull/15586 This will be the last one 🚀
Followup to https://github.com/python/mypy/pull/15586
Followup to https://github.com/python/mypy/pull/15586
Opening files with the same variable name in with statements in if statements fails type checks if the type of the result of the with statement is different. In this...
Followup to #15586
First of all, I'm using Mypy 0.770. I'd like to annotate a function in the following way: ```python T = TypeVar('T') class JSONSerialized(str, Generic[T]): """Strong type for the JSON serialized...
**Documentation** This issue is being created as a request to provide guidance in the official Mypy documentation about the recommended best practices and approaches that users should use when adding...
Add the strict mode for [PEP 698](https://peps.python.org/pep-0698/#strict-enforcement-per-project). Closes: #14072
Currently, MyPy doesn't report an error when a variable is imported in the `if TYPE_CHECKING` block and then used elsewhere. For example, MyPy accepts this code: ```python from typing import...
The following code produces a false positive: ```py from collections import namedtuple from typing import Any T = namedtuple("T", ["x"]) class C(T): def f(self) -> bool: return True c: C...