mypy
mypy copied to clipboard
Optional static typing for Python
**Bug Report** [Refurb](https://github.com/dosisod/refurb) is a project that depends on Mypy internals to work properly. Since v1.7.0 of Mypy (specifically since https://github.com/python/mypy/pull/15770 was merged), Refurb no longer works, and instead emits...
Looks like the generic return type is being resolved even before a value of a concrete type is provided. ``` from typing import Type, TypeVar import functools T = TypeVar("T",...
#17292 added functools.partial support for Type objects; this PR adds a test that demonstrates the implementation incorrectly eagerly resolves generics.
**Bug Report** typically, `ctx.api.defer()` can be called in a plugin when there is insufficient information to defer calling to a future pass. this "works" for `get_dynamic_class_hook` but causes the dynamic...
Calling `float.__add__` with an integer as first argument is valid. **Example** ```python float.__add__(1, 2) ``` **Expected Behavior** Considering that the code fails at runtime, mypy should not accept this code....
**Bug Report** When using PySide6.QtCore.Property, I get a `[no-redef]` error on the property setter that says it's already defined. If this is a problem that PySide6 needs to fix I...
**Bug Report** When no `.mypy_cache` folder exists and a user runs `mypy --install-types --non-interactive ./`, mypy may fail on fundamental issues but suggest that the failure was because of "no...
```py foo = tuple[int, int]((1, 2, 3)) # no error boo: tuple[int, int] = (1, 2, 3) # error: Incompatible types in assignment (expression has type "Tuple[int, ...]", variable has...
```py a = [1,2] b: tuple[int, int] = tuple[int, int](a) # Incompatible types in assignment (expression has type "Tuple[int, ...]", variable has type "Tuple[int, int]") [assignment] ``` [playground](https://mypy-play.net/?mypy=latest&python=3.11&flags=show-error-context%2Cshow-column-numbers%2Cshow-error-codes%2Cstrict%2Ccheck-untyped-defs%2Cdisallow-any-decorated%2Cdisallow-any-expr%2Cdisallow-any-explicit%2Cdisallow-any-generics%2Cdisallow-any-unimported%2Cdisallow-incomplete-defs%2Cdisallow-subclassing-any%2Cdisallow-untyped-calls%2Cdisallow-untyped-decorators%2Cdisallow-untyped-defs%2Cno-implicit-optional%2Cno-implicit-reexport%2Cno-strict-optional%2Cstrict-equality%2Cwarn-incomplete-stub%2Cwarn-redundant-casts%2Cwarn-return-any%2Cwarn-unreachable%2Cwarn-unused-configs%2Cwarn-unused-ignores&gist=915ba06ff6b784ba9d5041146ccbc9bd) related: #15171
**Feature** If some attribute is not defined for a single union item (often `None`), we could give a hint that the type may need to be narrowed down. **Pitch** New...