-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed as not planned
Labels
as designedNot a bug, working as intendedNot a bug, working as intendedbugSomething isn't workingSomething isn't working
Description
Describe the bug
Pyright finds an issue in the following code snippet:
from typing import Protocol
class Repro(Protocol):
def foo(self) -> str:
"""docblock"""error: Function with declared return type "str" must return value on all code paths
"None" is incompatible with "str" (reportGeneralTypeIssues)
Things are fine if the code looks like this:
from typing import Protocol
class Repro(Protocol):
def foo(self) -> str:
"""docblock"""
...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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
as designedNot a bug, working as intendedNot a bug, working as intendedbugSomething isn't workingSomething isn't working