diff options
author | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2021-03-27 22:11:36 +0100 |
---|---|---|
committer | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2021-03-28 16:30:10 +0200 |
commit | d2db40c08433ca35dc9e5312e1d1b6404db65c33 (patch) | |
tree | e6a316c154f5d9f9d66e03b89b66c0402b352dff /pylint/checkers/similar.py | |
parent | cd4168366b79a7782287e0b7162fbfe4f67535f8 (diff) | |
download | pylint-git-d2db40c08433ca35dc9e5312e1d1b6404db65c33.tar.gz |
Redefining __hash__ without redefining __eq__ is suspicious
Diffstat (limited to 'pylint/checkers/similar.py')
-rw-r--r-- | pylint/checkers/similar.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pylint/checkers/similar.py b/pylint/checkers/similar.py index 6b6337d29..b594a032c 100644 --- a/pylint/checkers/similar.py +++ b/pylint/checkers/similar.py @@ -257,6 +257,11 @@ class LineSet: def __hash__(self): return id(self) + def __eq__(self, other): + if not isinstance(other, LineSet): + return False + return self.__dict__ == other.__dict__ + def enumerate_stripped(self, start_at=0): """return an iterator on stripped lines, starting from a given index if specified, else 0 |