mirror of
https://github.com/davidhalter/parso.git
synced 2026-05-25 17:58:57 +08:00
Ignore positional only arguments slash when listing params
This commit is contained in:
@@ -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):
|
||||||
|
|||||||
Reference in New Issue
Block a user