1
0
forked from VimPlug/jedi

testing should now work without duplicates

This commit is contained in:
David Halter
2012-09-22 16:36:39 +02:00
parent c7e8278ca4
commit 5982c7c93d
3 changed files with 10 additions and 3 deletions

View File

@@ -340,7 +340,7 @@ class Script(object):
else:
names.append(dynamic.RelatedName(d.names[0], d))
return sorted(names, key=lambda x: (x.module_path, x.start_pos))
return sorted(set(names), key=lambda x: (x.module_path, x.start_pos))
def get_in_function_call(self):
"""

View File

@@ -449,3 +449,10 @@ class RelatedName(BaseOutput):
@property
def description(self):
return "%s@%s,%s" % (self.text, self.start_pos[0], self.start_pos[1])
def __eq__(self, other):
return self.start_pos == other.start_pos \
and self.module_path == other.module_path
def __hash__(self):
return hash((self.start_pos, self.module_path))

View File

@@ -71,10 +71,10 @@ module_not_exists
#< (85,17), (75,24), (78,0), (81,17), (4,5)
#< (1,0), (85,17), (75,24), (78,0), (81,17), (4,5)
from import_tree import rename1
#< (78,8), (3,0), (4,20), (6,0), (81,32), (82,0), (6,0)
#< (78,8), (3,0), (4,20), (6,0), (81,32), (82,0)
rename1.abc
#< (78,8), (3,0), (4,20), (6,0), (81,32), (82,0)