Stefan Behnel <stefan...@behnel.de> added the comment:
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. :)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35582>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to