Ignore positional only arguments slash when listing params

This commit is contained in:
Dave Halter
2019-06-09 22:55:27 +02:00
parent ecbe2b9926
commit c3c16169b5
+9 -1
View File
@@ -548,7 +548,8 @@ def _create_params(parent, argslist_list):
if param_children[0] == '*' \ if param_children[0] == '*' \
and (len(param_children) == 1 and (len(param_children) == 1
or param_children[1] == ',') \ or param_children[1] == ',') \
or check_python2_nested_param(param_children[0]): or check_python2_nested_param(param_children[0]) \
or param_children[0] == '/':
for p in param_children: for p in param_children:
p.parent = parent p.parent = parent
new_children += param_children new_children += param_children
@@ -1161,6 +1162,13 @@ class Param(PythonBaseNode):
index -= 2 index -= 2
except ValueError: except ValueError:
pass pass
try:
keyword_only_index = self.parent.children.index('/')
if index > keyword_only_index:
# Skip the ` /, `
index -= 2
except ValueError:
pass
return index - 1 return index - 1
def get_parent_function(self): def get_parent_function(self):