diff options
| author | Claudiu Popa <pcmanticore@gmail.com> | 2016-02-13 23:25:35 +0000 |
|---|---|---|
| committer | Claudiu Popa <pcmanticore@gmail.com> | 2016-02-13 23:25:35 +0000 |
| commit | f470225c3633ccab3dbc5196607265b286f5aff6 (patch) | |
| tree | d1703552dc53f8602ea0d852c775ac14b3ea8da5 /astroid/protocols.py | |
| parent | 1d6ae93609b055e0f76728e75a15244fcc3421cd (diff) | |
| parent | 6d2529632bae545ff7564501cac14316d5ea9204 (diff) | |
| download | astroid-git-f470225c3633ccab3dbc5196607265b286f5aff6.tar.gz | |
Merge pull request #314 from PyCQA/arguments-215
Changed the way how parameters are being built
Diffstat (limited to 'astroid/protocols.py')
| -rw-r--r-- | astroid/protocols.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/astroid/protocols.py b/astroid/protocols.py index eada9764..7fdc6e29 100644 --- a/astroid/protocols.py +++ b/astroid/protocols.py @@ -304,6 +304,7 @@ def mulass_assigned_stmts(self, nodes, node=None, context=None, assign_path=None @assigned_stmts.register(treeabc.AssignName) @assigned_stmts.register(treeabc.AssignAttr) +@assigned_stmts.register(treeabc.Parameter) def assend_assigned_stmts(self, nodes, node=None, context=None, assign_path=None): return self.parent.assigned_stmts(self, context=context) @@ -311,7 +312,7 @@ def assend_assigned_stmts(self, nodes, node=None, context=None, assign_path=None def _arguments_infer_argname(self, name, context, nodes): # arguments information may be missing, in which case we can't do anything # more - if not (self.args or self.vararg or self.kwarg): + if not self.args and (not self.vararg and not self.kwarg): yield util.Uninferable return # first argument of instance/class method @@ -336,10 +337,10 @@ def _arguments_infer_argname(self, name, context, nodes): return # TODO: just provide the type here, no need to have an empty Dict. - if name == self.vararg: + if self.vararg and name == self.vararg.name: yield nodes.Tuple(parent=self) return - if name == self.kwarg: + if self.kwarg and name == self.kwarg.name: yield nodes.Dict(parent=self) return # if there is a default value, yield it. And then yield Uninferable to reflect |
