[Python-Dev] PyWeakref_GetObject() borrows its reference from... whom?
Larry Hastings
larry at hastings.org
Mon Oct 10 16:57:02 EDT 2016
On 10/10/2016 06:37 PM, Guido van Rossum wrote:
> Modified +1: you can't change the behavior of the existing API, but
> you can deprecate it and introduce a better one with a different name.
> We'll have until Python 4.0 to carry through the deprecation anyways.
> And I doubt this is the only C API change needed for happy gil-free
> coding...
First, "deprecate" won't work for these semantics for the Gilectomy
branch. I simply cannot safely support the semantics of the existing
function. All call sites need to change.
Second, consider that every function that returns a borrowed
reference--PyDict_GetItem(), PyList_GetItem()--has to change too, to
return an actual (non-borrowed) reference. It's going to be a major
upheaval in the C API.
For now I'm going to leave the names as-is and just change the semantics
everywhere. If this approach really works, and if we decide we want to
merge it back into trunk--and those are both still big if's--we can
revisit this decision.
I haven't yet ruled out abandoning reference counting completely and
going to 100% tracing garbage collecting,
//arry/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20161010/530ec3c3/attachment-0001.html>
More information about the Python-Dev
mailing list