STINNER Victor <vstin...@redhat.com> added the comment:

_PyList_ConvertToTuple(PyObject *v):
    assert(Py_REFCNT(v) == 1);

I don't think that _PyList_ConvertToTuple() usage is common enough to justify 
this micro-optimization.

IMHO "Py_REFCNT(v) == 1" assumption is too strong. Python internals can be very 
surprising, especially when borrowered references and the garbage collector 
comes into the game.

I concur with Serhiy and Raymond: it's too risky with very low benefit. It is 
likely to have no significant impact on macro benchmarks like 
https://pyperformance.readthedocs.io/ ( https://speed.python.org/ ).

----------
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

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

Reply via email to