Ask Your Question

Wing incorrectly infers dictionary as set

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

massung's avatar

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

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

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

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



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

Seen: 282 times

Last updated: Nov 14 '22