Message333463
It might be worth inlining a fast path of "_PyArg_CheckPositional()" that only tests "nargs < min || nargs > max" (even via a macro), and then branches to the full error checking and reporting code only if that fails. Determining the concrete exception to raise is not time critical, but the good case is. Also, that would immediately collapse into "nargs != minmax" for the cases where "min == max", i.e. we expect an exact number of arguments.
And yes, a function that raises the expected exception with the expected error message for a hand full of common cases would be nice. :) |
|
Date |
User |
Action |
Args |
2019-01-11 12:37:29 | scoder | set | recipients:
+ scoder, vstinner, larry, serhiy.storchaka, xtreak |
2019-01-11 12:37:27 | scoder | set | messageid: <1547210247.59.0.660182684775.issue35582@roundup.psfhosted.org> |
2019-01-11 12:37:27 | scoder | link | issue35582 messages |
2019-01-11 12:37:27 | scoder | create | |
|