-
Notifications
You must be signed in to change notification settings - Fork 135
Closed
astral-sh/ruff
#20368Labels
ProtocolsbugSomething isn't workingSomething isn't workinggenericsBugs or features relating to ty's generics implementationBugs or features relating to ty's generics implementationtype propertiessubtyping, assignability, equivalence, and moresubtyping, assignability, equivalence, and more
Description
The return type of str.join should be str here, not LiteralString:
from typing import reveal_type
def _(pair: tuple[str, str]):
reveal_type(", ".join(pair)) # ty: LiteralStringSeems related to the fact that we seem to think that tuple[str, str] or Iterable[str] is assignable to Iterable[LiteralString]:
from typing import LiteralString, Iterable
def _(iterable: Iterable[str]):
x: Iterable[LiteralString] = iterable # this should be an errorMetadata
Metadata
Assignees
Labels
ProtocolsbugSomething isn't workingSomething isn't workinggenericsBugs or features relating to ty's generics implementationBugs or features relating to ty's generics implementationtype propertiessubtyping, assignability, equivalence, and moresubtyping, assignability, equivalence, and more