bpo-45476: Convert PyFloat_AS_DOUBLE() to static inline#28961
Conversation
Convert the following macros to static inline functions to disallow using them as l-value: * PyByteArray_AS_STRING() * PyBytes_AS_STRING() * PyFloat_AS_DOUBLE() PyUnicode_AS_UNICODE() becomes an alias to PyUnicode_AsUnicode().
|
I convert this PR to a draft since there is disagreement: https://bugs.python.org/issue45476#msg403956 |
Sorry, something went wrong.
|
This PR is stale because it has been open for 30 days with no activity. |
Sorry, something went wrong.
|
I wrote PEP 670 https://www.python.org/dev/peps/pep-0670/ to decide what's the best approach to fix https://bugs.python.org/issue45476 |
Sorry, something went wrong.
|
The PEP 670 is not accepted yet. This PR does two things:
Since both changes seem to be controversial, I prefer to limit the change to (1): I wrote the PR #28976 for that. I abandon this PR for now. Once the (1) change will be done and the PEP 670 will be accepted, it will be non controversial to convert these macros to static inline functions. For now, I prefer to abandon this PR. |
Sorry, something went wrong.
Convert the following macros to static inline functions to disallow
using them as l-value:
PyUnicode_AS_UNICODE() becomes an alias to PyUnicode_AsUnicode().
https://bugs.python.org/issue45476