First time here? Check out the FAQ!
1

Wing incorrectly infers dictionary as set

In the following code, Wing infers zs to be a set() when it's really a dict():

xs = {'a': 10}

ys = {'b': 20}

zs = {**xs, **ys}

This causes annoyances later on with things like zs.get(...) being highlighted as an error, saying that get isn't a method of a set().

massung's avatar
41
massung
asked 2022-11-04 17:13:22 -0500
Wingware Support's avatar
4.1k
Wingware Support
updated 2022-11-07 07:24:33 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

I see this also and we'll try to fix it. It looks like you can work around it by using instead:

zs: dict = {**xs, **ys}
Wingware Support's avatar
4.1k
Wingware Support
answered 2022-11-07 07:24:08 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer