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

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
massung's avatar
41
massung
asked 2 years ago
Wingware Support's avatar
4.3k
Wingware Support
updated 2 years ago

Comments

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}

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Wingware Support's avatar
4.3k
Wingware Support
answered 2 years ago
link

Comments

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

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)