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** Mypy complains when default an unpacked TypeVarTuple (`tuple[*Ts]`) to an empty tuple, but accepts one as input, which seems a conflicting behaviour at least. **To Reproduce** https://mypy-play.net/?mypy=latest&python=3.12&gist=9c2fa71781c45ed24b1901b8e9252e64 ```python...

bug
topic-pep-646

(Forwarded from https://github.com/python/typing/issues/1523) I'm trying to annotate a method that only accepts a union of specific types, with the types specified via variadic generic. Although mypy supports variadic unpacking like...

feature
topic-pep-646

**Bug Report** `operator.call` and similar `ParamSpec` callables (e.g. `concurrent.futures.Executor.submit`) produce an `arg-type` error when doing `call(fn, fn2, some_kwarg=...)` where `fn` has signature `(fn2: Callable[[Unpack[Ts]], T], *args: Unpack[Ts], some_kwarg: ...) ->...

bug
topic-pep-646

```py # mypy: disable-error-code=empty-body from typing import Any, Protocol, Unpack, TypeVarTuple Ts = TypeVarTuple("Ts") class A1(Protocol[Unpack[Ts]]): def f(self, *args: Unpack[Ts]) -> None: ... class B1: def f(self, x: str) ->...

bug
topic-pep-646

**Bug Report** Looks like pytest fails in few units. **To Reproduce** I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test...

bug

It's time for the next public release! I'll probably cut the branch at https://github.com/python/mypy/commit/43a605f742bd554acbdff9bea74c764621e3aa44. If there's any fixes or really important changes you'd like to make the cut, please post...

meta

Enables the narrowing of variable types when checking a variable is "in" a collection, and the collection type is a subtype of the variable type. Fixes #3229 (Explain how this...

upnext

**Bug Report** MyPy doesn't raise a warning if you pass in an class implementation that enforces positional arguments on a method, for a protocol that does not. **To Reproduce** Example...

bug

Fixes #12046 It does not raise "already defined" fail if already existing node is `InitVar`, so name of the property will be redefined. Then, when getting the method of that...

upnext

```py # Some stub from typing import TypeVar T = TypeVar("T") def something(x: T = ...) -> T: """x, the parameter for everything (formally Twitter)""" # some other file f:...

bug