diff options
author | Claudiu Popa <pcmanticore@gmail.com> | 2017-04-12 17:14:25 +0300 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2017-04-12 17:14:25 +0300 |
commit | 42cb54487a993b61ab6c9a70100f09e16ea51bab (patch) | |
tree | a0701107111a6f45e5648ef9f18d13455464f45c /astroid/rebuilder.py | |
parent | 12b673267dce7c899ca384792386ed9b657fe66a (diff) | |
download | astroid-git-42cb54487a993b61ab6c9a70100f09e16ea51bab.tar.gz |
Arguments node gained a new attribute, kwonlyargs_annotations, for holding the keyword-only args annotations
Diffstat (limited to 'astroid/rebuilder.py')
-rw-r--r-- | astroid/rebuilder.py | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/astroid/rebuilder.py b/astroid/rebuilder.py index 115a8d45..60a1ad77 100644 --- a/astroid/rebuilder.py +++ b/astroid/rebuilder.py @@ -183,12 +183,26 @@ class TreeRebuilder(object): None for child in node.kw_defaults] annotations = [self.visit(arg.annotation, newnode) if arg.annotation else None for arg in node.args] + kwonlyargs_annotations = [ + self.visit(arg.annotation, newnode) if arg.annotation else None + for arg in node.kwonlyargs + ] else: kwonlyargs = [] kw_defaults = [] annotations = [] - newnode.postinit(args, defaults, kwonlyargs, kw_defaults, - annotations, varargannotation, kwargannotation) + kwonlyargs_annotations = [] + + newnode.postinit( + args=args, + defaults=defaults, + kwonlyargs=kwonlyargs, + kw_defaults=kw_defaults, + annotations=annotations, + kwonlyargs_annotations=kwonlyargs_annotations, + varargannotation=varargannotation, + kwargannotation=kwargannotation + ) # save argument names in locals: if vararg: newnode.parent.set_local(vararg, newnode) |