How to rewrite this dictionary definition so PyCharm does not warn? My understanding is that the form it is currently in is already dictionary literal. I'm using PyCharm 2017.2.4, but I don't think the version matters.
Asked
Active
Viewed 1,099 times
3
-
Yep, that's definitely a dict-literal... Does it go away when you put it all on one line? – juanpa.arrivillaga Dec 12 '17 at 00:53
-
No, it does not. – qazwsx Dec 12 '17 at 00:54
-
1Aha! Have you seen this [here](https://stackoverflow.com/questions/8406242/why-does-pycharms-inspector-complain-about-d) ? – juanpa.arrivillaga Dec 12 '17 at 00:58
-
The problem is not reproducible in 2017.3. – user2235698 Dec 12 '17 at 14:01
2 Answers
0
You could try:
my_dict = dict( key1 = 'value1' )
It's a different notation. Not sure why PyCharm is complaining about what you entered before. But you should also make sure you have the latest edition of PyCharm.
Also, click on the "more..." link (shown in your image) to see what it says. It might even be helpful! :)

GaryMBloom
- 5,350
- 1
- 24
- 32