mirror of
https://github.com/davidhalter/jedi.git
synced 2026-02-17 06:24:11 +08:00
move __getattr__ checks
This commit is contained in:
@@ -231,14 +231,11 @@ class NameFinder(object):
|
|||||||
if result:
|
if result:
|
||||||
break
|
break
|
||||||
|
|
||||||
if not result and isinstance(nscope, er.Instance):
|
|
||||||
# __getattr__ / __getattribute__
|
|
||||||
result += self._check_getattr(nscope)
|
|
||||||
debug.dbg('sfn filter "%s" in (%s-%s): %s@%s'
|
debug.dbg('sfn filter "%s" in (%s-%s): %s@%s'
|
||||||
% (self.name_str, self.scope, nscope, u(result), self.position))
|
% (self.name_str, self.scope, nscope, u(result), self.position))
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def names_to_types(self, names):
|
def names_to_types(self, names, is_goto=True):
|
||||||
result = names
|
result = names
|
||||||
# This adds additional types
|
# This adds additional types
|
||||||
flow_scope = self.scope
|
flow_scope = self.scope
|
||||||
@@ -251,6 +248,10 @@ class NameFinder(object):
|
|||||||
break
|
break
|
||||||
flow_scope = flow_scope.parent
|
flow_scope = flow_scope.parent
|
||||||
|
|
||||||
|
if not result and isinstance(self.scope, er.Instance):
|
||||||
|
# __getattr__ / __getattribute__
|
||||||
|
result += self._check_getattr(self.scope)
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def _check_getattr(self, inst):
|
def _check_getattr(self, inst):
|
||||||
|
|||||||
Reference in New Issue
Block a user