Pyright correctly reports reportInconsistentConstructor. However, the error message is not great:
Mismatch between signature of __new__ and __init__ in class "X"
Signature of __init__ is "(..., a: int)"
Signature of __new__ is "..." (reportInconsistentConstructor)
I would interpret Signature of __new__ is "..." to mean that it's a signature like Callable[..., T], but that's not what's happening here.
Given this program:
Pyright correctly reports
reportInconsistentConstructor
. However, the error message is not great:I would interpret
Signature of __new__ is "..."
to mean that it's a signature likeCallable[..., T]
, but that's not what's happening here.This came up in python/typeshed#12346.