Closed qi55wyqu closed 1 month ago
Just by chance: are you missing self
in either base class or in the override?
Thank you for taking a look at this!
I dont' think I'm missing self
. In that case I would expect an exception at runtime but the code works fine otherwise.
The following code generates the IndexError
with mypy 1.11.0 and Python 3.12.4:
from typing import Callable, TypedDict, Unpack
class Kwargs(TypedDict):
name: str
def f(**kwargs: Kwargs) -> None:
pass
class C:
d: Callable[[Unpack[Kwargs]], None]
class D(C):
d = f
OK, interesting, so it is essentially what I guessed, but it looks like mypy is wrong, IIUC it shouldn't try to bind self
in d
. Probably an easy fix, but I will be busy next few days.
Crash Report
Mypy crashes when using Unpack and TypedDict.
Traceback
To Reproduce
Unfortunately I cannot narrow down problem to a small example. The crash happens in an inherited class which does not overload init.
Your Environment
--show-traceback --cache-dir=/dev/null