mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-30 08:44:21 +08:00
fix a magic method problem
This commit is contained in:
@@ -787,8 +787,8 @@ def follow_path(path, scope, call_scope, position=None):
|
|||||||
|
|
||||||
def filter_private_variable(scope, call_scope, var_name):
|
def filter_private_variable(scope, call_scope, var_name):
|
||||||
"""private variables begin with a double underline `__`"""
|
"""private variables begin with a double underline `__`"""
|
||||||
if isinstance(var_name, (str, unicode)) \
|
if isinstance(var_name, (str, unicode)) and isinstance(scope, er.Instance)\
|
||||||
and var_name.startswith('__') and isinstance(scope, er.Instance):
|
and var_name.startswith('__') and not var_name.endswith('__'):
|
||||||
s = call_scope.get_parent_until((pr.Class, er.Instance))
|
s = call_scope.get_parent_until((pr.Class, er.Instance))
|
||||||
if s != scope and s != scope.base.base:
|
if s != scope and s != scope.base.base:
|
||||||
return True
|
return True
|
||||||
|
|||||||
@@ -224,6 +224,8 @@ A.__init__
|
|||||||
#? ['__init__']
|
#? ['__init__']
|
||||||
B.__init__
|
B.__init__
|
||||||
|
|
||||||
|
#? ['__init__']
|
||||||
|
int().__init__
|
||||||
|
|
||||||
# -----------------
|
# -----------------
|
||||||
# comments
|
# comments
|
||||||
|
|||||||
Reference in New Issue
Block a user