-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type issue in a protocol method if ...
is missing from the body
#6487
Comments
Protocols are allowed to provide default implementations of methods, and classes that derive from these protocols inherit these implementations. A method that does not include a |
Thank you for the quick response Eric! This makes sense, and I hope Ruff resolves it soon. |
Just making a note that this behaviour is not (yet) aligned with Pylint, which raises |
aligning with pylint is also important. unless it is envisioned that if one uses pyright should not use pylint or other linters.
the only way to make them both happy is
since Any can be none I guess, and pyright is happy. |
Describe the bug
Pyright finds an issue in the following code snippet:
Things are fine if the code looks like this:
However after changes to PIE790 in Ruff v0.1.6, Ruff wants to remove the
...
- resulting the Pyright error.@zanieb from @astral-sh thinks that nothing in PEP 544 requires the
...
and that Pyright shouldn't see a problem here. See astral-sh/ruff#8756 (comment)@erictraut – what's your view? It would be great if Pyright and Ruff were to agree on what's legal here.
VS Code extension or command-line
Pyright 1.1.336 CLI
The text was updated successfully, but these errors were encountered: