Author scoder
Recipients larry, scoder, serhiy.storchaka, vstinner, xtreak
Date 2019-01-11.12:37:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1547210247.59.0.660182684775.issue35582@roundup.psfhosted.org>
In-reply-to
Content
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. :)
History
Date User Action Args
2019-01-11 12:37:29scodersetrecipients: + scoder, vstinner, larry, serhiy.storchaka, xtreak
2019-01-11 12:37:27scodersetmessageid: <1547210247.59.0.660182684775.issue35582@roundup.psfhosted.org>
2019-01-11 12:37:27scoderlinkissue35582 messages
2019-01-11 12:37:27scodercreate