[issue25923] More const char

2015-12-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Excuse my troubling. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue25923] More const char

2015-12-26 Thread Stefan Krah
Stefan Krah added the comment: There's no need to revert it. Both versions are okay, but I wanted to point out that these kinds of changes a) add a cognitive load for other developers (I have to look what has changed in memoryobject.c) and b) may override other developers' conscious decisions.

[issue25923] More const char

2015-12-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3cb3e224b692 by Serhiy Storchaka in branch 'default': Issue #25923: Added the const qualifier to static constant arrays. https://hg.python.org/cpython/rev/3cb3e224b692 -- nosy: +python-dev ___ Python

[issue25923] More const char

2015-12-25 Thread Stefan Krah
Stefan Krah added the comment: What is the point of changing the return value of a function in Objects/memoryobject.c to "const char *" and then casting it back to "char *" in the one place that the function is used? Churn like this has a direct cost for me: I have to update my private 100%

[issue25923] More const char

2015-12-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset 80d1faa9735d by Serhiy Storchaka in branch 'default': Issue #25923: Added more const qualifiers to signatures of static and private functions. https://hg.python.org/cpython/rev/80d1faa9735d -- ___

[issue25923] More const char

2015-12-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Sorry. Do you prefer to revert this change or left it as is? -- ___ Python tracker ___

[issue25923] More const char

2015-12-25 Thread Stefan Krah
Stefan Krah added the comment: I was faced with the same dilemma when I wrote the code and I *deliberately* decided that returning (const char *) + an additional cast wasn't worth it for a static function that's used only once. -- ___ Python tracker

[issue25923] More const char

2015-12-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: get_native_fmtstr() returns a pointer to C string literal. It is constant by its nature, and I thought it would be more clear to cast it explicitly if needed. It would be better (in particular for compatibility with C++) to make Py_buffer.format to be const

[issue25923] More const char

2015-12-22 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Proposed patch adds the const qualifier to char* parameter declarations and static char arrays if appropriate. This makes the code more strict and can help to catch bugs or generate more efficient code. In additional it can decrease memory consumption by