Mark Shannon <m...@hotpy.org> added the comment:

I'm not convinced that this is worth the effort.

The old functions aren't going away, so these additional functions provide no 
real safety.
You can't stop C programmers trading away correctness for some perceived 
performance benefit :(

If we were designing the API from scratch, then this would be a better set of 
functions. But because the old functions remain, it just means we are making 
the API larger.


Please don't add macros, use inline functions.

There seems to be some confusion about borrowed references and stolen 
references in https://pythoncapi.readthedocs.io/bad_api.html#borrowed-references
"Stealing" a reference is perfectly safe. Returning a "borrowed" reference is 
not.

So, don't bother with `PyTuple_SetItemRef()`, as `PyTupleSetItem()` is safe.

----------
nosy: +Mark.Shannon

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

Reply via email to