forked from VimPlug/jedi
fixed a problem that combined __getattr__ and usages
This commit is contained in:
@@ -434,6 +434,10 @@ class Script(object):
|
||||
for d in set(definitions):
|
||||
if isinstance(d, pr.Module):
|
||||
names.append(api_classes.Usage(d, d))
|
||||
elif isinstance(d, er.Instance):
|
||||
# Instances can be ignored, because they are being created by
|
||||
# ``__getattr__``.
|
||||
pass
|
||||
else:
|
||||
names.append(api_classes.Usage(d.names[-1], d))
|
||||
|
||||
|
||||
@@ -132,6 +132,16 @@ class TestInstanceVar():
|
||||
self._instance_var
|
||||
|
||||
|
||||
class NestedClass():
|
||||
def __getattr__(self, name):
|
||||
return self
|
||||
|
||||
# Shouldn't find a definition, because there's no name defined (used ``getattr``).
|
||||
|
||||
#< (0, 14),
|
||||
NestedClass().instance
|
||||
|
||||
|
||||
# -----------------
|
||||
# inheritance
|
||||
# -----------------
|
||||
|
||||
Reference in New Issue
Block a user