String partition complains about something strange #10599
Answered
by
brianschubert
Evgeniy Krysanov (catcombo)
asked this question in
Q&A
|
I'm trying to split string into three parts by using the following code: id, _, name = "id:name".partition(":")pyright complains: What dict? I have only new variables on the left side. There are no dicts, only tuple of the same size that |
Answered by
brianschubert
Jun 12, 2025
Replies: 1 comment 1 reply
|
Presumably you previously assigned a _: dict
# much later...
id, _, name = "id:name".partition(":") # E: Type "LiteralString" is not assignable to declared type "dict[Unknown, Unknown]" |
1 reply
Answer selected by
catcombo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Presumably you previously assigned a
dictto_somewhere, e.g.