diff --git a/jedi/evaluate.py b/jedi/evaluate.py index cc597cc8..38d3ebc5 100644 --- a/jedi/evaluate.py +++ b/jedi/evaluate.py @@ -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 diff --git a/test/completion/basic.py b/test/completion/basic.py index 9ce4dad4..41e489e6 100644 --- a/test/completion/basic.py +++ b/test/completion/basic.py @@ -224,6 +224,8 @@ A.__init__ #? ['__init__'] B.__init__ +#? ['__init__'] +int().__init__ # ----------------- # comments