diff --git a/jedi/parser/tree.py b/jedi/parser/tree.py index 0044973d..27fd89f0 100644 --- a/jedi/parser/tree.py +++ b/jedi/parser/tree.py @@ -763,14 +763,16 @@ class Class(ClassOrFunc): children = arglist.children except AttributeError: if arglist is not None: - yield arglist + for node_to_execute in arglist.nodes_to_execute(): + yield node_to_execute else: for argument in children: if argument.type == 'argument': # metaclass= or list comprehension or */** raise NotImplementedError('Metaclasses not implemented') else: - yield argument + for node_to_execute in argument.nodes_to_execute(): + yield node_to_execute # care for the class suite: for node in self.children[self.children.index(':'):]: diff --git a/test/static_analysis/class_simple.py b/test/static_analysis/class_simple.py new file mode 100644 index 00000000..3f84fde0 --- /dev/null +++ b/test/static_analysis/class_simple.py @@ -0,0 +1,13 @@ +class Base(object): + class Nested(): + def foo(): + pass + + +class X(Base.Nested): + pass + + +X().foo() +#! 4 attribute-error +X().bar()