mirror of
https://github.com/davidhalter/jedi.git
synced 2026-01-01 01:33: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):
|
||||
"""private variables begin with a double underline `__`"""
|
||||
if isinstance(var_name, (str, unicode)) \
|
||||
and var_name.startswith('__') and isinstance(scope, er.Instance):
|
||||
if isinstance(var_name, (str, unicode)) and isinstance(scope, er.Instance)\
|
||||
and var_name.startswith('__') and not var_name.endswith('__'):
|
||||
s = call_scope.get_parent_until((pr.Class, er.Instance))
|
||||
if s != scope and s != scope.base.base:
|
||||
return True
|
||||
|
||||
@@ -224,6 +224,8 @@ A.__init__
|
||||
#? ['__init__']
|
||||
B.__init__
|
||||
|
||||
#? ['__init__']
|
||||
int().__init__
|
||||
|
||||
# -----------------
|
||||
# comments
|
||||
|
||||
Reference in New Issue
Block a user