From 418000589306b2dae458f18ad130c9875bbf62bf Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Thu, 4 Sep 2014 12:53:34 +0200 Subject: [PATCH] Forgot to add the the params in the case of a class in the previous commit. --- jedi/parser/__init__.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/jedi/parser/__init__.py b/jedi/parser/__init__.py index 594a14ee..b45c89fa 100644 --- a/jedi/parser/__init__.py +++ b/jedi/parser/__init__.py @@ -192,8 +192,11 @@ class Parser(object): param, tok = self._parse_statement(added_breaks=breaks, stmt_class=pr.Statement if is_class else pr.Param) - if not is_class: - if param and tok.string == ':': + if is_class: + if param is not None: + params.append(param) + else: + if param is not None and tok.string == ':': # parse annotations annotation, tok = self._parse_statement(added_breaks=breaks) if annotation: @@ -201,7 +204,7 @@ class Parser(object): # function params without vars are usually syntax errors. # expressions are valid in superclass declarations. - if param and param.get_defined_names(): + if param is not None and param.get_defined_names(): param.position_nr = pos params.append(param) pos += 1