[issue20227] Argument Clinic: rename arguments in generated C?

Zachary Ware report at bugs.python.org
Mon Jan 13 04:51:12 CET 2014


Zachary Ware added the comment:

I second this request.  Every PyArg_ParseTupleAndKeywords-using function in _winapi has a keyword argument "overlapped" which is stuffed into a C variable "use_overlapped", while the local variable "overlapped" is used for an Overlapped object, which makes for a big hairy diff.  There are also several PyArg_ParseTuple-using functions that have the same kind of name mismatch, but since the names don't really mean anything on the Python side when they're positional-only, I don't feel too bad about changing them to make them make sense (or to avoid churn).

Although, for this:

Georg Brandl wrote:
> sometimes the function uses 'O' in PyArg_ParseTuple and then converts the object itself with a nontrivial process.

This kind of case is a good candidate for considering a custom converter; posixmodule.c has a good example with a path_t converter that I used for a guide in writing one for HKEY in winreg.c.  Of course, if that 'nontrivial process' is only done once in one function, a custom converter doesn't make a whole lot of sense, but a rename does.

----------
nosy: +zach.ware

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20227>
_______________________________________


More information about the Python-bugs-list mailing list