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

I'm planning to make a 1.4 release around early July. (This is actually meant to be the June release but it is delayed). Please post here any issues you'd like...

meta

Currently, unboxing tuples first involve doing a tuple *cast* to do error checks in advance. This hack was added because the error handling code for unboxing tuples is busted and...

topic-mypyc

Migrate failure messages to message_registry.py. This is an attempt to address the issue #6116

[PEP 698](https://peps.python.org/pep-0698/) adds an `@override` decorator. Todo: - [x] basic support for `@override` (done in #14609) - [ ] optional [strict mode](https://peps.python.org/pep-0698/#strict-enforcement-per-project) (relevant discussion: https://github.com/python/typing/issues/1376 ) Related issue: #1888

feature
topic-inheritance

When running `mypy` following the procedure below, I encounter several errors for the overloaded `open` builtin of the form: ``` ../python3.11/site-packages/mypy/typeshed/stdlib/builtins.pyi:1327: error: Argument 8 to "open" becomes "Optional[Any]" due to...

**Bug Report** Although `reveal_type` claims that `@property` objects are simply callables of the type of function they decorate, mypy does know that they have `setter` and `getter` attributes. However, if...

bug
topic-descriptors

Fixes https://github.com/python/mypy/issues/15141 This adds a check if `iter_type` is a union type so that `expr_type` is set to the generator return type instead of none.

Resolve #14603 `encoding` should be explicit, even when opting for the default behavior (`"locale"`) https://peps.python.org/pep-0597/ This is motivated by eliminating [`EncodingWarning`s in `pytest-mypy`](https://github.com/realpython/pytest-mypy/issues/152).

**Bug Report** If an abstract base class has a `__init__` that is annotated as `@abc.abstractmethod`, the signature should be verified for clients implementing the `__init__`. This does not seem to...

bug
topic-inheritance

**Bug Report** mypy gives a false positive with variable `_` (underscore) under certain circumstances (see repro). **To Reproduce** https://mypy-play.net/?mypy=latest&python=3.8&flags=disallow-any-expr&gist=bca874771ec5eba30815133c9bbd4ab7 ```python from typing import Callable, Tuple, TypeVar T = TypeVar("T") def...

bug
topic-disallow-any