[New-bugs-announce] [issue35582] Argument Clinic: inline parsing code for functions with only positional parameters
report at bugs.python.org
Tue Dec 25 09:40:52 EST 2018
New submission from Serhiy Storchaka <storchaka+cpython at gmail.com>:
This is a continuation of issue23867. The proposed PR makes Argument Clinic inlining parsing code for functions with only positional parameters, i.e. functions that use PyArg_ParseTuple() and _PyArg_ParseStack() now. This saves time for parsing format strings and calling few levels of functions. It can save also a C stack, because of lesser number of nested (and potentially recursive) calls, lesser number of variables, and getting rid of a stack allocated array for "objects" which will need to be deallocated or cleaned up if overall parsing fails.
PyArg_ParseTuple() and _PyArg_ParseStack() will still be used if there are parameters for which inlining converter is not supported. Unsupported converters are deprecated Py_UNICODE API ("u", "Z"), encoded strings ("es", "et"), obsolete string/bytes converters ("y", "s#", "z#"), some custom converters (DWORD, HANDLE, pid_t, intptr_t).
components: Argument Clinic
nosy: larry, serhiy.storchaka
title: Argument Clinic: inline parsing code for functions with only positional parameters
versions: Python 3.8
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce