summaryrefslogtreecommitdiff
path: root/astroid/rebuilder.py
diff options
context:
space:
mode:
authorAshley Whetter <ashley@awhetter.co.uk>2020-01-11 14:23:30 -0800
committerAshley Whetter <ashley@awhetter.co.uk>2020-01-11 14:23:30 -0800
commit061aaebea2be2d21831ef687cc4ba4a25d953c65 (patch)
treebca65f06791bb0075b794d1f975fef0bbc2a98d7 /astroid/rebuilder.py
parent616c7cec3cb06161dba83710db7083c6bc62e116 (diff)
downloadastroid-git-061aaebea2be2d21831ef687cc4ba4a25d953c65.tar.gz
Can access positional only and keyword only argument type comments
Diffstat (limited to 'astroid/rebuilder.py')
-rw-r--r--astroid/rebuilder.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/astroid/rebuilder.py b/astroid/rebuilder.py
index 10fd5900..6cb36f67 100644
--- a/astroid/rebuilder.py
+++ b/astroid/rebuilder.py
@@ -221,6 +221,14 @@ class TreeRebuilder:
type_comment_args = [
self.check_type_comment(child, parent=newnode) for child in node.args
]
+ type_comment_kwonlyargs = [
+ self.check_type_comment(child, parent=newnode) for child in node.kwonlyargs
+ ]
+ if PY38:
+ type_comment_posonlyargs = [
+ self.check_type_comment(child, parent=newnode)
+ for child in node.posonlyargs
+ ]
newnode.postinit(
args=args,
@@ -234,6 +242,8 @@ class TreeRebuilder:
varargannotation=varargannotation,
kwargannotation=kwargannotation,
type_comment_args=type_comment_args,
+ type_comment_kwonlyargs=type_comment_kwonlyargs,
+ type_comment_posonlyargs=type_comment_posonlyargs,
)
# save argument names in locals:
if vararg: