Closed hrpatil closed 1 month ago
I'm not able to repro the problem with recent versions of pyright. The reason you're seeing errors in the pyright playground is that you have it set to pyright 1.1.353, which is quite old. If you switch to a more recent version of pyright, you should see the errors go away.
I've tested on the latest version of Pyright and can confirm there is no issue. The problem was indeed with an outdated version in my virtual environment. Updating Pyright resolved the errors. Thank you for your help in identifying this, and I appreciate your quick response to my report.
There appears to be a discrepancy between mypy and Pyright in how they handle overloaded methods with a union of callable types. The following code passes mypy checks without any errors, but Pyright reports "Overloaded implementation is not consistent with signature of overload" errors.
Code sample in pyright playground
Code sample in mypy play-net
pylance version : 2024.9.1 (9 September 2024) Release - No error pyright version: 1.1.381 - 4 errors