Commit 8e1bfe7f authored by Stefan Behnel's avatar Stefan Behnel

Make code more readable by changing the order of a condition and moving the...

Make code more readable by changing the order of a condition and moving the simple return case first.
parent c7550f6d
......@@ -903,7 +903,9 @@ class CArgDeclNode(Node):
def analyse(self, env, nonempty=0, is_self_arg=False):
if is_self_arg:
self.base_type.is_self_arg = self.is_self_arg = True
if self.type is None:
if self.type is not None:
return self.name_declarator, self.type
# The parser may misinterpret names as types. We fix that here.
if isinstance(self.declarator, CNameDeclaratorNode) and self.declarator.name == '':
if nonempty:
......@@ -947,8 +949,6 @@ class CArgDeclNode(Node):
if arg_type is not None:
base_type = arg_type
return self.declarator.analyse(base_type, env, nonempty=nonempty)
else:
return self.name_declarator, self.type
def inject_type_from_annotations(self, env):
annotation = self.annotation
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment