-
Notifications
You must be signed in to change notification settings - Fork 284
Open
Labels
needs-discussionAn issue where it's not clear whether there is a bug or we are behaving as expected.An issue where it's not clear whether there is a bug or we are behaving as expected.typechecking
Description
Describe the Bug
This appears to be a false-positive type error from pyrefly. Using str.split on a LiteralString ends up with confusion between list[str] and list[LiteralString]:
ERROR sandbox.py:6:5-6: Argument
list[LiteralString]is not assignable to parameterxwith typelist[str]in functionfoo[bad-argument-type]
def foo(x: list[str]) -> None:
pass
l = 'a b c d'.split()
foo(l)Sandbox Link
(Only applicable for extension issues) IDE Information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
needs-discussionAn issue where it's not clear whether there is a bug or we are behaving as expected.An issue where it's not clear whether there is a bug or we are behaving as expected.typechecking