mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 14:04:26 +08:00
NameFinder.filter_name is simpler now.
This commit is contained in:
@@ -69,8 +69,13 @@ class NameFinder(object):
|
||||
# reference.
|
||||
name_list = sorted(name_list, key=lambda n: n.start_pos, reverse=True)
|
||||
for name in name_list:
|
||||
if self.name_str != name.get_code():
|
||||
continue
|
||||
|
||||
parpar = name.parent.parent
|
||||
if self.name_str == name.get_code() and parpar not in break_scopes:
|
||||
if name.parent.parent in break_scopes:
|
||||
continue
|
||||
|
||||
if not self._name_is_array_assignment(name):
|
||||
result.append(name) # `arr[1] =` is not the definition
|
||||
# for comparison we need the raw class
|
||||
|
||||
@@ -1387,6 +1387,9 @@ class NamePart(object):
|
||||
def __eq__(self, other):
|
||||
return self.string == other
|
||||
|
||||
def __ne__(self, other):
|
||||
return not self.__eq__(other)
|
||||
|
||||
def __hash__(self):
|
||||
return hash(self.string)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user