-
Notifications
You must be signed in to change notification settings - Fork 216
Closed
astral-sh/ruff
#20368Labels
ProtocolsgenericsBugs or features relating to ty's generics implementationBugs or features relating to ty's generics implementation
Description
Given:
import urllib.parse
def func(url: str) -> str:
parsed = urllib.parse.urlparse(url)
return urllib.parse.urlunparse(parsed)Returns:
error[invalid-return-type]: Return type does not match returned value
--> main.py:4:23
|
4 | def func(url: str) -> str:
| --- Expected `str` because of return type
5 | parsed = urllib.parse.urlparse(url)
6 | return urllib.parse.urlunparse(parsed)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `str`, found `Literal[b""]`
|
info: rule `invalid-return-type` is enabled by default
Found 1 diagnostic
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
ProtocolsgenericsBugs or features relating to ty's generics implementationBugs or features relating to ty's generics implementation