mypy
mypy copied to clipboard
Optional static typing for Python
Add a `ColoredHelpFormatter` argparse formatter class that colors the command line arguments of mypy CLI help. The formatter uses the existing `FancyFormatter` for the coloring itself and the detection of...
Fix checking multiple assignments based on tuple unpacking involving partially initialised variables (Fixes #12915). This proposal is an alternative to #14423. Similar to #14423, the main idea is to convert...
Fix checking multiple assignments based on tuple unpacking involving partially initialised variables (Fixes #12915). This commit introduces two changes: * It converts unions of tuples to tuples of unions during...
```py from typing import Iterator, Callable from contextlib import contextmanager class E: a: str def f(e: E) -> None: with cm(): if e.a: pass reveal_type(e.a) # Revealed type is "builtins.str"...
**Documentation** Within the CLI we have the command line switch `--enable-incomplete-feature` which expects a feature name to enable. Until now I have not been able to find a list of...
**Bug Report** mypy generates "error: Non-overlapping identity check" for identity comparison between optionals, even though None has the same identity as None. This is especially confusing for the `x is...
(Explain how this PR changes mypy.) stubgen currently allows a variable to be an alias to another, but only at the module level. For example: ```python def func() -> int:...
Add binary files to stubgen blacklisted path. `.so` for Linux and macOS. `.dll` for Windows. Fixes #14028 References: https://github.com/python/typeshed/tree/main/stubs/pywin32 and https://github.com/python/typeshed/tree/main/stubs/tree-sitter-languages/%40tests
**Bug Report** Mypy cannot determine the type of the declared field inside a protocol method. **To Reproduce** Invoke mypy on the following Python file ```python # bug.py from typing import...
**Feature** ```py A = 1 A = 2 ``` make A be treated as ```py from typing import Final A: Final = 1 A = 2 ``` thus, it will...