mypy
mypy copied to clipboard
Optional static typing for Python
This PR is related with the issue #16295 Checklist: - Clarifies error reporting when a decorator (or decorator factory) supplies an incompatible callable signature, including the decorated function’s name. -...
I've kicked off a [discussion on typing-sig](https://mail.python.org/archives/list/[email protected]/thread/66JDHQ2I3U3CPUIYA43W7SPEJLLPUETG/), as some of you have already seen, to talk about deprecating and eventually removing type comments. Currently, the ast module takes `type_comments=True` to...
Partially addresses #5917. This PR refactors the `parse_test_case` function in `mypy/test/data.py` by extracting the logic that parses `[out]` and `[outN]` sections into a new private helper, `_handle_out_section()`. This reduces the...
> Could there also be links (both ways) between those and the documentation of the different error codes that are affected by the configuration options (eg. between `--disallow-any-generics`, `disallow_any_generics` and...
This Pull Request adds an error report when a dataclass field is declared as `Final`, has `init=False`, and lacks a default value, as discussed in Issue #13119. This change adds...
Description for command line flags and configuration file options are today split across 2 different documentations ([here](https://mypy.readthedocs.io/en/stable/command_line.html) for CLI flags, and [here](https://mypy.readthedocs.io/en/stable/config_file.html) for options). Despite the options mostly behaving the...
Unexpected type is inferred for attribute `x` in this example: ```python class C: def __init__(self) -> None: if int(): self.x = None return self.x = [] self.x.append("x") reveal_type(C().x) # "list[str]"...
Ines
Work in progress for issue #9991 . More work is needed, including tests and adjustments.
Work in progress for issue https://github.com/python/mypy/issues/9991 . More work is needed, including tests and adjustments.