Ask Your Question
1

Wing incorrectly infers dictionary as set

asked 2022-11-04 17:13:22 -0600

massung's avatar

updated 2022-11-07 07:24:33 -0600

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().

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-11-07 07:24:08 -0600

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}
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2022-11-04 17:13:22 -0600

Seen: 90 times

Last updated: Nov 14