Message209777
These are very unusual semantics.
The convention in the python api is that functions are refernece-invariant when there are errors. i.e. if a function fails or not does not change the caller's reference passing assumptions.
For example, Py_BuildValue("N", myobject);
takes care to always steal the reference of myobject, even when Py_BuildValue fails.
Thi tehe case of _PyBytes_Resize(), the caller owns the (single) reference to the operand, and owns the reference to it (or a new one) on success. It is highly unusual that the case of failure causes it to no longer own this reference.
Python 3 should have taken the opportunity to remove remove this unusual inheritance from _PyString_Resize() |
|
Date |
User |
Action |
Args |
2014-01-31 12:18:53 | kristjan.jonsson | set | recipients:
+ kristjan.jonsson, vstinner, asvetlov, serhiy.storchaka, qualab |
2014-01-31 12:18:53 | kristjan.jonsson | set | messageid: <1391170733.1.0.920698473166.issue20434@psf.upfronthosting.co.za> |
2014-01-31 12:18:53 | kristjan.jonsson | link | issue20434 messages |
2014-01-31 12:18:52 | kristjan.jonsson | create | |
|