[issue31229] wrong error messages when too many kwargs are received
Serhiy Storchaka
report at bugs.python.org
Thu Aug 17 14:30:22 EDT 2017
Serhiy Storchaka added the comment:
In all of these cases PyArg_ParseTupleAndKeywords() is used in uncommon way. These functions accept variable number of positional-only arguments, and PyArg_ParseTupleAndKeywords() is called with empty args tuple for parsing keyword arguments only. The patch uses a trick for detecting this case and generating more appropriate error message. Correct error message is generated in a normal case too.
LGTM. But it may be worth to add a short comment about the necessary of this special case. And please add tests for error messages in all of these functions. test_call looks appropriate place for them.
----------
nosy: +haypo, serhiy.storchaka
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue31229>
_______________________________________
More information about the Python-bugs-list
mailing list