1
0
forked from VimPlug/jedi

fix tests. Operators should not equal to other operators with a different position. or even parent.

This commit is contained in:
Dave Halter
2014-08-18 13:12:39 +02:00
parent 1d812c2414
commit 9f38f10366
3 changed files with 10 additions and 4 deletions

View File

@@ -1587,8 +1587,14 @@ class Operator(Simple):
return self.get_code()
def __eq__(self, other):
"""Make comparisons easy. Improves the readability of the parser."""
return self.string == other
"""
Make comparisons with strings easy.
Improves the readability of the parser.
"""
if isinstance(other, Operator):
return self is other
else:
return self.string == other
def __ne__(self, other):
"""Python 2 compatibility."""