Commits

larry committed 250b481

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.

Comments (0)

Files changed (2)

 Tools/Demos
 -----------
 
+- 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.
+
 - Issue #18960: 2to3 and the findnocoding.py script now ignore the source
   encoding declaration on the second line if the first line contains anything
   except a comment.

Tools/clinic/clinic.py

             count_min = min(count_min, count)
             count_max = max(count_max, count)
 
+            if count == 0:
+                add("""    case 0:
+        break;
+""")
+                continue
+
             group_ids = {p.group for p in subset}  # eliminate duplicates
             d = {}
             d['count'] = count