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

**Bug Report** I think I've uncovered a false positive in `mypy`'s type-checking of `is` operator with `Enum`s. See below for details. I know that `Enum`s are a bit funky, so...

bug
topic-enum
topic-overlap

**Bug Report** When defining a function expecting a generic class and a generic value — tied to the same `TypeVar` —, mypy is not able to infer the type of...

bug
topic-typed-dict

## Objective This PR introduces a new HTML reporter (`html-direct`) that generates reports directly using Python, without relying on XSLT transformations. This solves the long-standing issue #909 regarding WebKit browsers...

**Bug Report** In the example below, mypy reveals the type to be `Any`, whereas Pyright correctly detects `Bar` Note that replacing `T | None` with `T` makes Mypy also infer...

bug
topic-calls
topic-pep-696

**To Reproduce** ```python from typing import Any import numpy as np import numpy.typing as npt def plus1(array: npt.NDArray[np.integer[Any]]) -> None: array += 1 ``` **Expected Behavior** No error **Actual Behavior**...

bug
topic-overloads

This pull request contributes to issue #5917, which encourages the decomposition and simplification of overly long methods to improve code clarity and maintainability. ### Summary of changes Refactored the `combine_function_signatures`...

**Bug Report** mypy is raising an internal error when attempting to combine special types in a TypedDict using the alternative functional syntax. **To Reproduce** ```python from typing import NotRequired, TypedDict...

bug
crash

`--extra-checks` was added per this review comment: https://github.com/python/mypy/pull/15425#issuecomment-1604275753 I think a big advantage of mypy relative to other type checkers is that it is relatively configurable. mypy's always had a...

meta
topic-configuration

*Memo: mypy --strict test.py mypy 1.19.0 Python 3.14.0 Windows 11 With a new syntax generic function, `T` cannot be used to set a default value to a parameter with [cast()](https://docs.python.org/3/library/typing.html#typing.cast)...

bug
pending

Consider the following: ``` uv run runtests.py testTemplateString usage: runtests.py [self] [self-packaging] [lint] [pytest-fast] [pytest-cmdline] [pytest-slow] [mypyc-fast] [pytest-extra] [mypyc-extra] [names of individual tests and files...] Run the given tests. If...

bug
topic-tests