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:
@@ -451,7 +451,7 @@ def get_names_of_scope(evaluator, scope, position=None, star_search=True, includ
|
||||
After that we have a few underscore names that have been defined
|
||||
|
||||
>>> pairs[2]
|
||||
(<ModuleWrapper: <SubModule: None@1-5>>, [<FakeName: __file__@0,0>, ...])
|
||||
(<ModuleWrapper: <SubModule: None@1-5>>, [<LazyName: __file__@0,0>, ...])
|
||||
|
||||
|
||||
Finally, it yields names from builtin, if `include_builtin` is
|
||||
|
||||
@@ -11,7 +11,6 @@ def fast_parent_copy(obj):
|
||||
"""
|
||||
new_elements = {}
|
||||
accept = (pr.Simple, pr.NamePart)
|
||||
start=obj
|
||||
|
||||
def recursion(obj):
|
||||
if isinstance(obj, pr.Statement):
|
||||
@@ -93,6 +92,7 @@ def call_signature_array_for_pos(stmt, pos):
|
||||
if new_arr is not None:
|
||||
return new_arr, index
|
||||
|
||||
# TODO couldn't we merge with the len(arr) == 0 check?
|
||||
if arr.start_pos < pos <= stmt.end_pos:
|
||||
if arr.type in accepted_types and isinstance(arr.parent, pr.Call):
|
||||
return arr, i
|
||||
|
||||
@@ -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."""
|
||||
|
||||
Reference in New Issue
Block a user