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
It seems like the _PyArg_VaParseTupleAndKeywordsFast() function is no longer used in the Python code base.
Moreover, Argument Clinic (Tools/clinic/clinic.py) can produce code calling the _PyArg_ParseTupleAndKeywordsFast() function, but it is not the case currently: _PyArg_ParseStackAndKeywords() is used instead.
What's the status of these two functions, _PyArg_ParseStackAndKeywords() and _PyArg_VaParseTupleAndKeywordsFast()?
Argument Clinic currently unrolls parsing functions, generating a sequence of converter calls for individual parameters. But it does not support all cases, and when it fail to generate parsing code for all parameters, it falls back to traditional method, calling _PyArg_ParseTupleAndKeywordsFast or _PyArg_ParseStackAndKeywords. The former is used for __new__ and init`, the latter for other methods.
So it happened that _PyArg_ParseTupleAndKeywordsFast is not used in currently generated code. But it will be used if we convert to Argument Clinic some classes with constructors which need it.
_PyArg_VaParseTupleAndKeywordsFast is not used and AFAIK never was used. It was added for symmetry, for the case if we make this interface public.
You can remove _PyArg_VaParseTupleAndKeywordsFast, but itself it will not save much code. You can defer this until we remove also _PyArg_ParseTupleAndKeywordsFast (and possible _PyArg_ParseStackAndKeywords) by ensuring that Argument Clinic no longer needs such fallback. Or until we add them (reworked) to the public API, so they could be used without Argument Clinic.
changed the title [-]Argument Clinic: is _PyArg_ParseTupleAndKeywordsFast() still used or not?[/-][+]Remove unused _PyArg_ParseTupleAndKeywordsFast()[/+]on Jul 27, 2023
Activity
pythongh-107196: Remove _PyArg_VaParseTupleAndKeywordsFast() function
pythongh-107196: Remove _PyArg_VaParseTupleAndKeywordsFast() function
vstinner commentedon Jul 24, 2023
PR #107197 is the easy part: remove the unused private
_PyArg_VaParseTupleAndKeywordsFast()function.serhiy-storchaka commentedon Jul 25, 2023
Argument Clinic currently unrolls parsing functions, generating a sequence of converter calls for individual parameters. But it does not support all cases, and when it fail to generate parsing code for all parameters, it falls back to traditional method, calling
_PyArg_ParseTupleAndKeywordsFastor_PyArg_ParseStackAndKeywords. The former is used for__new__and init`, the latter for other methods.So it happened that
_PyArg_ParseTupleAndKeywordsFastis not used in currently generated code. But it will be used if we convert to Argument Clinic some classes with constructors which need it._PyArg_VaParseTupleAndKeywordsFastis not used and AFAIK never was used. It was added for symmetry, for the case if we make this interface public.You can remove
_PyArg_VaParseTupleAndKeywordsFast, but itself it will not save much code. You can defer this until we remove also_PyArg_ParseTupleAndKeywordsFast(and possible_PyArg_ParseStackAndKeywords) by ensuring that Argument Clinic no longer needs such fallback. Or until we add them (reworked) to the public API, so they could be used without Argument Clinic.gh-107196: Remove _PyArg_VaParseTupleAndKeywordsFast() function (#107197
[-]Argument Clinic: is _PyArg_ParseTupleAndKeywordsFast() still used or not?[/-][+]Remove unused _PyArg_ParseTupleAndKeywordsFast()[/+][-]Remove unused _PyArg_ParseTupleAndKeywordsFast()[/-][+]Remove unused _PyArg_VaParseTupleAndKeywordsFast()[/+]vstinner commentedon Oct 17, 2023
Let's keep _PyArg_ParseStackAndKeywords() for now. PR #110966 moves it to the internal C API, so it will be easier to remove it later if needed.