[issue21011] PyArg_ParseTupleAndKeywords doesn't take const char *keywords[]

Hristo Venev report at bugs.python.org
Fri Mar 21 17:45:16 CET 2014


New submission from Hristo Venev:

This really annoys me. I have to store the literals in char[] and then make a char*[] from them. It would be better if a simple array of string literals could be used. It would also require less data space because string literals could be merged by the compiler.

I don't know why PyArg_ParseTupleAndKeywords would ever modify the keywords array so it makes absolutely no sense to me for the array not to be const char*[].

In all cases I have seen PyArg_ParseTupleAndKeywords being used string literals were converted to char* (dropping const) which is far far worse than inefficient code.

----------
components: Extension Modules
messages: 214388
nosy: h.venev
priority: normal
severity: normal
status: open
title: PyArg_ParseTupleAndKeywords doesn't take const char *keywords[]
type: resource usage
versions: Python 3.4

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


More information about the Python-bugs-list mailing list