Closed maflAT closed 1 month ago
Thanks for the bug report. Yes, this is behaving incorrectly.
When pyright sees an overloaded __init__
or __new__
, it is supposed to fall back on the overload's implementation to verify constructor consistency. The code was indeed doing this, but it was not binding the implementation to the class, which means that the self
and cls
parameters for __init__
and __new__
(respectively) will not match.
This will be fixed in the next release.
This is addressed in pyright 1.1.372.
As soon as overloads are defined for
__new__
or__init__
reportInconsistentConstructor will be triggered, even if the overloads are identical.Code sample in pyright playground