Skip to content
Discussion options

You must be logged in to vote
d: dict[str, str] = vars(arguments)
v: list[int] = d['arg']             # L12

In line 11 (first line above) you are claiming that the dict returned by vars(arguments) has str values. And then in line 12 you try to assign one of those (supposedly) str values to a list[int]. You should change line 11 to either of those:

d = vars(arguments)
d: dict[str, Any] = vars(arguments)  # the annotation is redundant, but you might prefer explicit annotations

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by dineshbvadhia
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants