mypy
mypy copied to clipboard
Optional static typing for Python
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...
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...
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
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...
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 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...