diff options
author | Claudiu Popa <pcmanticore@gmail.com> | 2019-07-09 10:15:47 +0200 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2019-07-09 13:05:42 +0300 |
commit | 3bee58474a9367826a997b1e760a538a253d71c7 (patch) | |
tree | 4cfd022b800338307c4c2f14a2f9848266b27c71 /astroid/rebuilder.py | |
parent | 55a05c73f164af373640800ec266f38a38fc9d58 (diff) | |
download | astroid-git-3bee58474a9367826a997b1e760a538a253d71c7.tar.gz |
Add support for positional only arguments in astroid for python 3.8
Diffstat (limited to 'astroid/rebuilder.py')
-rw-r--r-- | astroid/rebuilder.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/astroid/rebuilder.py b/astroid/rebuilder.py index a3e1f243..4cf40097 100644 --- a/astroid/rebuilder.py +++ b/astroid/rebuilder.py @@ -193,6 +193,7 @@ class TreeRebuilder: defaults = [self.visit(child, newnode) for child in node.defaults] varargannotation = None kwargannotation = None + posonlyargs = [] # change added in 82732 (7c5c678e4164), vararg and kwarg # are instances of `_ast.arg`, not strings if vararg: @@ -224,12 +225,15 @@ class TreeRebuilder: kw_defaults = [] annotations = [] kwonlyargs_annotations = [] + if PY38: + posonlyargs = [self.visit(child, newnode) for child in node.posonlyargs] type_comment_args = [self.check_type_comment(child) for child in node.args] newnode.postinit( args=args, defaults=defaults, kwonlyargs=kwonlyargs, + posonlyargs=posonlyargs, kw_defaults=kw_defaults, annotations=annotations, kwonlyargs_annotations=kwonlyargs_annotations, |