mypy
mypy copied to clipboard
Optional static typing for Python
Source: https://github.com/python/cpython/blob/4fe5585240f64c3d14eb635ff82b163f92074b3a/Lib/enum.py#L1118 Typeshed: https://github.com/python/typeshed/blob/f9cedff5af015cd2814b3e9ed05ebe10e778585d/stdlib/enum.pyi#L82-L97 We would need to treat it as `.is_enum`.
**Bug Report** MyPy doesn't seem to understand that dataclasses can generate an `__eq__` method. If it's required (such as in an ABC), then it doesn't know that it was created....
**Bug Report** Hello, I want to do something like: ```python def match(info: RequestContext): match info: case RequestContext.ForPopup(data_only_in_popup_context=data): print(data) case RequestContext.ForDetailPage(data_only_in_detail_page=data): print(data) ``` However I'm getting unreachable warnings when --warn-unreachable is...
Fixes #14487 (Explain how this PR changes mypy.) This PR would like to explicit the fact that when you follow the steps in the [Contributing Guidelines](https://github.com/python/mypy/blob/master/CONTRIBUTING.md) and you run the...
**Bug Report** Following the [contributor guide](https://github.com/python/mypy/blob/master/CONTRIBUTING.md) I run the command `python3 runtests.py` and I got an error, based on the python version that I use in my virtualenv vs the...
When doing multiple passes, in the example below, `range` will refer to current's module range. When doing a single pass, `range` will refer to `builtins.range`: ```python _range = range _C...
Regular trait attributes are accessed via looking up the field offset from a vtable. This doesn't work with native ints, since they may also require access to a defined attributes...
Generate specialized, efficient IR for various operations on bools. These are covered: * Bool comparisons * Mixed bool/integer comparisons * Bool arithmetic (binary and unary) * Mixed bool/integer arithmetic and...
This generates an error on latest error but not on mypy 0.991 ```python from typing import TypedDict D = TypedDict("D", {"foo": int}, total=False) def f(d: dict[str, D]) -> None: args...
The following code generates an error on latest master but no on latest release (with `--enable-error-codes=truthy-bool`): ```python def f(obj: object) -> None: print("{}".format( getattr(type(obj), "__foo__", "") or "unknown" # E:...