diff options
author | Claudiu Popa <pcmanticore@gmail.com> | 2014-07-29 11:36:15 +0300 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2014-07-29 11:36:15 +0300 |
commit | bf919348a823a573ebbb7c435626172ba21b7c3c (patch) | |
tree | f6bee267871fb7b66e49f26a542d549a84e525a6 /protocols.py | |
parent | 70b05d23a03218cd16bcde339f4ba50dc4a8f27a (diff) | |
download | astroid-git-bf919348a823a573ebbb7c435626172ba21b7c3c.tar.gz |
Set the parent of vararg and kwarg nodes when inferring them. Closes issue #43.
Diffstat (limited to 'protocols.py')
-rw-r--r-- | protocols.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/protocols.py b/protocols.py index 7ce1faa6..d621ffb6 100644 --- a/protocols.py +++ b/protocols.py @@ -231,10 +231,14 @@ def _arguments_infer_argname(self, name, context): yield self.parent.parent.frame() return if name == self.vararg: - yield const_factory(()) + vararg = const_factory(()) + vararg.parent = self + yield vararg return if name == self.kwarg: - yield const_factory({}) + kwarg = const_factory({}) + kwarg.parent = self + yield kwarg return # if there is a default value, yield it. And then yield YES to reflect # we can't guess given argument value |