mypy icon indicating copy to clipboard operation
mypy copied to clipboard

Optional static typing for Python

Results 1055 mypy issues
Sort by recently updated
recently updated
newest added

Fixes #17896 ### Changes 1. `COMPARISON_OVERLAP` errors are being filtered on the assert statement 2. Regarding the reachability issue, I have also implemented `suppress_unreachable_warnings()` after assert statements. I'm not sure...

I have a number of concrete classes which all derive from the same abstract base class. Creating a list of instances using `__subclasses__()` in a list comprehension, mypy complains that...

bug

We are planning to change the defaults of some options in mypy 2.0, and it's likely that we'll have more such changes in mypy 3.0 and so on. Some of...

feature
topic-configuration

**Feature** In assert statements, allow comparisons that don't appear to overlap. These are common in test cases, and tend to generate false positives. One way to implement this would be...

feature
needs discussion
false-positive
topic-overlap

In my work environment, we editably install most Python packages. This leads to long search paths, e.g. 200 entries is common. I think it should be possible to significantly improve...

feature
performance

Hi, I've defined a custom enum base to copy the names of the enum items as values when using `auto()`. Mypy curiously throws an `assignment` error about incompatible types when...

topic-enum

**Bug Report** playground: https://mypy-play.net/?mypy=latest&python=3.12&gist=8c0d1a3a8e3f444fc12af3f803e18c59 ```python from typing import Callable, TypeVar _T = TypeVar("_T") def Field(default_factory: Callable[[], _T]) -> _T: ... # type: ignore[empty] def new_list() -> list[int]: return [] class...

bug

**Bug Report** A function that takes in a function with a broad signature and returns a narrowed partially-applied function now reports `error: Too few arguments [call-arg]` in mypy 1.12. **To...

bug

sorry for https://github.com/python/mypy/pull/17972 and thanks @Viicos

**Bug Report** Consider (https://mypy-play.net/?mypy=latest&python=3.12&gist=8afb9e0642a24aad8c26f3d22045ce18) ```python from typing import ClassVar class Base: x : ClassVar[tuple[str, ...]] = () class Concrete(Base): x = ("foo",) class Derived(Concrete): x = ("foo", "bar") reveal_type(Base.x) #...

bug