Errors detected in .deepsource.toml
.
items()
to iterate over a dictionary PTC-W0011data.items()
to iterate over the dictionary 49 },
50 }
51 self.data = {}
52 for key in data: 53 self.data.update({('{}-{}'.format(key, k), v)
54 for (k, v) in list(data[key].items())})
55 self.data['{}-current_step'.format(self.wizard_class_slug)] = 'extra'
The preferred way to iterate over the key-value pairs of a dictionary is to declare two variables in a for loop, and then call dictionary.items()
(or dictionary.iteritems()
for Python2), where dictionary is the name of your variable representing a dictionary.'
details = {"first_name": "Alfred", "last_name":"Hitchcock"}
for key in details.keys():
print(key, d[key])
details = {"first_name": "Alfred", "last_name":"Hitchcock"}
for key, value in details.items():
print(key, value)