Open
Description
from typing import NewType
from typing_extensions import Self
class C:
def foo(self: Self, other: Self) -> int: raise NotImplementedError
D = NewType('D', C)
d = D(C())
d.foo(42) # E: Argument 1 to "foo" of "C" has incompatible type "int"; expected "D"
This is pretty minor, but "foo" of "C"
here feels misleading. Would it be clearer to name the instance's type?
Playground: https://mypy-play.net/?mypy=latest&python=3.11&gist=9b6fe04dddab8ed91a41c819bff3854a