[Python-Dev] Baffled by PyArg_ParseTupleAndKeywords modification
Tim Peters
tim.peters at gmail.com
Fri Feb 10 19:27:35 CET 2006
More information about the Python-Dev mailing list
Fri Feb 10 19:27:35 CET 2006
- Previous message: [Python-Dev] Baffled by PyArg_ParseTupleAndKeywords modification
- Next message: [Python-Dev] Baffled by PyArg_ParseTupleAndKeywords modification
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
[Jeremy] >>> I added some const to several API functions that take char* but >>> typically called by passing string literals. [Tim] >> If he had _stuck_ to that, we wouldn't be having this discussion :-) >> (that is, nobody passes string literals to >> PyArg_ParseTupleAndKeywords's kws argument). [Jeremy] > They are passing arrays of string literals. In my mind, that was a > nearly equivalent use case. I believe the C++ compiler complains > about passing an array of string literals to char**. It's the consequences: nobody complains about tacking "const" on to a former honest-to-God "char *" argument that was in fact not modified, because that's not only helpful for C++ programmers, it's _harmless_ for all programmers. For example, nobody could sanely object (and nobody did :-)) to adding const to the attribute-name argument in PyObject_SetAttrString(). Sticking to that creates no new problems for anyone, so that's as far as I ever went.
- Previous message: [Python-Dev] Baffled by PyArg_ParseTupleAndKeywords modification
- Next message: [Python-Dev] Baffled by PyArg_ParseTupleAndKeywords modification
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list