You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When fixing some bugs (#118814, #122688) I noticed also design problems in _PyArg_UnpackKeywordsWithVararg().
Its vararg parameter is always equal to maxpos, therefore it is redundant.
Inserting a new tuple between values for positional and keyword-only parameters adds complexity in the _PyArg_UnpackKeywordsWithVararg() code which caused bugs.
Since it is the only argument value which is a strong reference, it adds complexity for cleanup after calling _PyArg_UnpackKeywordsWithVararg().
This large code is mostly a duplication of _PyArg_UnpackKeywords().
But it lacks some microoptimizations.
And produces wrong error messages in some corner cases.
Also some cases (like var-positional parameter after optional parameters) were not supported.
So I re-worked it in several steps:
Removed the vararg parameter from _PyArg_UnpackKeywordsWithVararg().
Moved creation of the tuple for var-positional parameter out from _PyArg_UnpackKeywordsWithVararg().
Refactored Argument Clinic code: it now generates similar code for var-positional parameter in functions with and without keyword parameters. The generated code is now more optimal and more cases are now supported. This is a large step.
Finally, _PyArg_UnpackKeywordsWithVararg() was merged with _PyArg_UnpackKeywords() which now got a new flag.
When fixing some bugs (#118814, #122688) I noticed also design problems in
_PyArg_UnpackKeywordsWithVararg().varargparameter is always equal tomaxpos, therefore it is redundant._PyArg_UnpackKeywordsWithVararg()code which caused bugs._PyArg_UnpackKeywordsWithVararg()._PyArg_UnpackKeywords().So I re-worked it in several steps:
varargparameter from_PyArg_UnpackKeywordsWithVararg()._PyArg_UnpackKeywordsWithVararg()._PyArg_UnpackKeywordsWithVararg()was merged with_PyArg_UnpackKeywords()which now got a new flag.Linked PRs