Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:

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().

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue26200>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to