8000 Fix a bug which allows more than one varargs · python/cpython@6793f38 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6793f38

Browse files
committed
Fix a bug which allows more than one varargs
Python allows at most *one* vararg in one function. Remove the improper varargs check which allows function definition like ``` *vararg1: object *vararg2: object ``` in argument clinic.
1 parent 3ac4e78 commit 6793f38

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Tools/clinic/clinic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ def output_templates(self, f):
650650
vararg = NO_VARARG
651651
pos_only = min_pos = max_pos = min_kw_only = pseudo_args = 0
652652
for i, p in enumerate(parameters, 1):
653-
if p.is_keyword_only() or vararg != NO_VARARG:
653+
if p.is_keyword_only():
654654
assert not p.is_positional_only()
655655
if not p.is_optional():
656656
min_kw_only = i - max_pos

0 commit comments

Comments
 (0)
0