3

enter image description here

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.

qazwsx
  • 25,536
  • 30
  • 72
  • 106

2 Answers2

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
0

I resolved the issue by

my_dict = {
    'key1': 'value1'
}

pass
qazwsx
  • 25,536
  • 30
  • 72
  • 106