Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 583baa8

Browse files
committed
Issue #20196: Fixed a bug where Argument Clinic did not generate correct
parsing code for functions with positional-only parameters where all arguments are optional.
1 parent a70805e commit 583baa8

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

Misc/NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ Tests
7272
Tools/Demos
7373
-----------
7474

75+
- Issue #20196: Fixed a bug where Argument Clinic did not generate correct
76+
parsing code for functions with positional-only parameters where all arguments
77+
are optional.
78+
7579
- Issue #18960: 2to3 and the findnocoding.py script now ignore the source
7680
encoding declaration on the second line if the first line contains anything
7781
except a comment.

Tools/clinic/clinic.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,12 @@ def render_option_group_parsing(self, f, template_dict):
591591
count_min = min(count_min, count)
592592
count_max = max(count_max, count)
593593

594+
if count == 0:
595+
add(""" case 0:
596+
break;
597+
""")
598+
continue
599+
594600
group_ids = {p.group for p in subset} # eliminate duplicates
595601
d = {}
596602
d['count'] = count

0 commit comments

Comments
 (0)