[issue31527] Report details of excess arguments in object_new & object_init

2017-09-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: str(x=1) is not the best example since str() takes keyword arguments. Look at tuple() and list(): >>> tuple(x=1) Traceback (most recent call last): File "", line 1, in TypeError: tuple() takes no keyword arguments >>> list(x=1) Traceback (most recent call

[issue31527] Report details of excess arguments in object_new & object_init

2017-09-19 Thread Nick Coghlan
Nick Coghlan added the comment: Adding a dependency on issue 31506, as this shouldn't be tackled until those simpler amendments are resolved. -- dependencies: +Improve the error message logic for object_new & object_init ___ Python tracker

[issue31527] Report details of excess arguments in object_new & object_init

2017-09-19 Thread Nick Coghlan
New submission from Nick Coghlan: object_new and object_init currently use their own argument checking logic, and hence haven't benefited from the error reporting enhancements in PyArg_ParseTupleAndKeywords Compare: >>> str(1, 2, 3, 4, 5, x=1) Traceback (most recent call last): File "",