Skip to content

Commit bebce2c

Browse files
committed
Clean ununsed variables in iterations
1 parent 34c6790 commit bebce2c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mongoengine/base/fields.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def _validate_choices(self, value):
171171

172172
choice_list = self.choices
173173
if isinstance(choice_list[0], (list, tuple)):
174-
choice_list = [k for k, v in choice_list]
174+
choice_list = [k for k, _ in choice_list]
175175

176176
# Choices which are other types of Documents
177177
if isinstance(value, (Document, EmbeddedDocument)):
@@ -311,7 +311,7 @@ def to_python(self, value):
311311
value_dict[k] = self.to_python(v)
312312

313313
if is_list: # Convert back to a list
314-
return [v for k, v in sorted(value_dict.items(),
314+
return [v for _, v in sorted(value_dict.items(),
315315
key=operator.itemgetter(0))]
316316
return value_dict
317317

@@ -378,7 +378,7 @@ def to_mongo(self, value):
378378
value_dict[k] = self.to_mongo(v)
379379

380380
if is_list: # Convert back to a list
381-
return [v for k, v in sorted(value_dict.items(),
381+
return [v for _, v in sorted(value_dict.items(),
382382
key=operator.itemgetter(0))]
383383
return value_dict
384384

0 commit comments

Comments
 (0)