[issue39591] Functions in Python/traceback.c can take const pointer arguments

2020-02-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Even if the object is not modified currently in common case, it does not guarantee that it cannot be modified in uncommon cases, or that it cannot be modified in future after introducing changes in different files. For example, if names was created by the

[issue39591] Functions in Python/traceback.c can take const pointer arguments

2020-02-10 Thread Andy Lester
Andy Lester added the comment: > Yes, Py_INCREF and Py_DECREF change the type, and therefore constness. Understood. The changes that I have proposed are not to objects that get sent through Py_INCREF/Py_DECREF. If they did, -Wcast-qual would have caught it. -Wcast-qual catches if you cast,

[issue39591] Functions in Python/traceback.c can take const pointer arguments

2020-02-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, Py_INCREF and Py_DECREF change the type, and therefore constness. -- ___ Python tracker ___ __

[issue39591] Functions in Python/traceback.c can take const pointer arguments

2020-02-09 Thread Andy Lester
Andy Lester added the comment: I'm sorry, I think my comment was misleading. The changes I had proposed were not making the object itself const, but some of the arguments in the static worker functions. For example: -tb_displayline(PyObject *f, PyObject *filename, int lineno, PyObject *name

[issue39591] Functions in Python/traceback.c can take const pointer arguments

2020-02-09 Thread Andy Lester
Change by Andy Lester : -- pull_requests: -17798 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue39591] Functions in Python/traceback.c can take const pointer arguments

2020-02-09 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> rejected stage: patch review -> resolved status: open -> closed ___ Python tracker ___ _

[issue39591] Functions in Python/traceback.c can take const pointer arguments

2020-02-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: They cannot. PyObject cannot be const because the code that uses it can change its reference counter even if it does not change any other fields. -- nosy: +serhiy.storchaka ___ Python tracker

[issue39591] Functions in Python/traceback.c can take const pointer arguments

2020-02-08 Thread Andy Lester
Change by Andy Lester : -- pull_requests: -17794 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue39591] Functions in Python/traceback.c can take const pointer arguments

2020-02-08 Thread Andy Lester
Change by Andy Lester : -- pull_requests: +17798 pull_request: https://github.com/python/cpython/pull/18422 ___ Python tracker ___ _

[issue39591] Functions in Python/traceback.c can take const pointer arguments

2020-02-08 Thread Andy Lester
Change by Andy Lester : -- keywords: +patch pull_requests: +17794 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18420 ___ Python tracker ___

[issue39591] Functions in Python/traceback.c can take const pointer arguments

2020-02-08 Thread Andy Lester
New submission from Andy Lester : The functions tb_displayline and tb_printinternal can take const pointers on some of their arguments. tb_displayline(PyObject *f, PyObject *filename, int lineno, const PyObject *name) tb_printinternal(const PyTracebackObject *tb, PyObject *f, long limit) --