[issue32240] Add the const qualifier for PyObject* array arguments

2017-12-15 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue32240] Add the const qualifier for PyObject* array arguments

2017-12-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset a5552f023e1d8cbafee1e51d316cc581deb2295f by Serhiy Storchaka in branch 'master': bpo-32240: Add the const qualifier to declarations of PyObject* array arguments. (#4746)

[issue32240] Add the const qualifier for PyObject* array arguments

2017-12-15 Thread Stefan Behnel
Stefan Behnel added the comment: Seems ok from Cython side. Could be a bit difficult to make an actual use of this, but at least it shouldn't break anything. And it's a reasonable constraint to enforce. -- ___ Python tracker

[issue32240] Add the const qualifier for PyObject* array arguments

2017-12-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This can affect Cython which uses the "fast call" convention. -- nosy: +scoder ___ Python tracker

[issue32240] Add the const qualifier for PyObject* array arguments

2017-12-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This change is inspired by reviewing one PR in which an input array of PyObject* was modified inplace. Even if it was correct in that particular case, it looked unsafe (actually that code was wrong for other causes). Adding

[issue32240] Add the const qualifier for PyObject* array arguments

2017-12-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I don't like "PyConstObjectArray" or any other name. I will just obfuscate the C code. "PyObject * const *args" should be clear for every C programmer, but if I see "PyConstObjectArray" I need to search the definition of it in

[issue32240] Add the const qualifier for PyObject* array arguments

2017-12-07 Thread STINNER Victor
STINNER Victor added the comment: I hate this "obscure" C syntax "PyObject * const *args". Technically, is it possible to define it as a type with a better name to give more context where the type would be defined? For example, "PyConstObjectArray"? --

[issue32240] Add the const qualifier for PyObject* array arguments

2017-12-07 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +4649 stage: -> patch review ___ Python tracker ___

[issue32240] Add the const qualifier for PyObject* array arguments

2017-12-07 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : The proposed PR replaces argument declarations "PyObject **args" with "PyObject * const *args". In many cases this can be a pointer to the internal array of the tuple object. It is not safe to change it. PyEval_EvalCodeEx()