Skip to content

Commit

Permalink
pylint: Fix consider-iterating-dictionary
Browse files Browse the repository at this point in the history
> Emitted when the keys of a dictionary are iterated through the
  ``.keys()`` method or when ``.keys()`` is used for a membership check.
  It is enough to iterate through the dictionary itself, ``for key in
  dictionary``. For membership checks, ``if key in dictionary`` is faster.

See pylint-dev/pylint#4069

Fixes: fleet-commander#279
Signed-off-by: Stanislav Levin <slev@altlinux.org>
  • Loading branch information
stanislavlevin committed Feb 17, 2022
1 parent 06cdae4 commit d0bae50
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion admin/fleetcommander/database.py
Expand Up @@ -98,7 +98,7 @@ def __setitem__(self, key, value):
self.__delitem__(key)

valuetype = type(value).__name__
if valuetype not in list(self._SUPPORTED_TYPES.keys()):
if valuetype not in self._SUPPORTED_TYPES:
raise ValueError("Type %s is not supported by SQLiteDict" % valuetype)

if valuetype in self._SERIALIZED_TYPES:
Expand Down

0 comments on commit d0bae50

Please sign in to comment.