Message380620
Py_SETREF() is simple wrappers around Py_DECREF() and assignment. If there are macros in Rust it is better to implement Py_SETREF() as Rust macro.
Py_SETREF() was not added to the limited API for reason. If arguments against Py_SETREF() are still valid, the same arguments are applicable to Py_SetRef(). And even if Py_SETREF() will be added to the limited C API I do not think that there is a need of adding Py_SetRef(). It is more cumbersome (additional &), slower and affects the optimization of surrounded code (pointer cannot be in register), and does not have any advantage in addition to the macro.
This issue was closed 4 years ago. Please open a new issue for Py_SetRef(). |
|
Date |
User |
Action |
Args |
2020-11-09 22:09:20 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, gvanrossum, rhettinger, belopolsky, vstinner, skrah, python-dev |
2020-11-09 22:09:20 | serhiy.storchaka | set | messageid: <1604959760.07.0.171514260942.issue26200@roundup.psfhosted.org> |
2020-11-09 22:09:20 | serhiy.storchaka | link | issue26200 messages |
2020-11-09 22:09:19 | serhiy.storchaka | create | |
|