1
0
forked from VimPlug/jedi

statical analysis shouldn't report the exact same error twice

This commit is contained in:
Dave Halter
2014-05-11 16:45:22 +02:00
parent 7abdc375c2
commit 3f2e737702
2 changed files with 11 additions and 1 deletions

View File

@@ -37,6 +37,16 @@ class Error(object):
def __str__(self):
return '%s: %s:%s' % (self.code, self.line, self.description())
def __eq__(self, other):
return (self.path == other.path and self.name == other.name
and self._start_pos == other._start_pos)
def __ne__(self, other):
return not self.__eq__(other)
def __hash__(self):
return hash((self.path, self._start_pos, self.name))
def __repr__(self):
return '<%s %s: %s@%s,%s' % (self.__class__.__name__,
self.name, self.path,