1
0
forked from VimPlug/jedi

Fix classes in static analysis.

This commit is contained in:
Dave Halter
2015-09-21 14:35:41 +02:00
parent 19a5643a2e
commit 1e8dba9253
+15 -9
View File
@@ -722,10 +722,10 @@ class Class(ClassOrFunc):
def get_super_arglist(self): def get_super_arglist(self):
if self.children[2] != '(': # Has no parentheses if self.children[2] != '(': # Has no parentheses
return [] return None
else: else:
if self.children[3] == ')': # Empty parentheses if self.children[3] == ')': # Empty parentheses
return [] return None
else: else:
return self.children[3] return self.children[3]
@@ -745,19 +745,25 @@ class Class(ClassOrFunc):
# Yield itself, class needs to be executed for decorator checks. # Yield itself, class needs to be executed for decorator checks.
yield self yield self
# Super arguments. # Super arguments.
for args in self.get_super_arglist: arglist = self.get_super_arglist()
if args.type == 'args': try:
# metaclass= or list comprehension or */** children = arglist.children
raise NotImplementedError('Metaclasses not implemented') except AttributeError:
else: if arglist is not None:
yield args yield arglist
else:
for argument in children:
if argument.type == 'argument':
# metaclass= or list comprehension or */**
raise NotImplementedError('Metaclasses not implemented')
else:
yield argument
# care for the class suite: # care for the class suite:
for node_to_execute in self.children[-1].nodes_to_execute(): for node_to_execute in self.children[-1].nodes_to_execute():
yield node_to_execute yield node_to_execute
def _create_params(parent, argslist_list): def _create_params(parent, argslist_list):
""" """
`argslist_list` is a list that can contain an argslist as a first item, but `argslist_list` is a list that can contain an argslist as a first item, but