On Thu, Apr 15, 2021 at 5:05 PM Shreyan Avigyan
<[email protected]> wrote:
>
> After going through the 
> https://github.com/python/cpython/blob/master/Include/object.h it seems that 
> Py_XDECREF is just calling Py_DECREF if the PyObject pointer is not NULL. 
> This if statement could be directly implemented in Py_DECREF right? Therefore 
> is it really required to have Py_XDECREF? Why not use a DeprecationWarning 
> for now and plan to deprecate Py_XDECREF in the near future?
> How about implementing an if statement in Py_DECREF to make it work like 
> Py_XDECREF?
>

If you know for sure that it isn't NULL, why have an unnecessary branch?

More importantly: why change things? How much is gained by the deprecation?

ChrisA
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/P4QEMISXG32X2M4GD4PHHQ4MYRNBNM6E/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to