A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2011-May/111202.html below:

[Python-Dev] Borrowed and Stolen References in API

[Python-Dev] Borrowed and Stolen References in API [Python-Dev] Borrowed and Stolen References in APIAmaury Forgeot d'Arc amauryfa at gmail.com
Thu May 5 12:38:32 CEST 2011
Hi,

Le jeudi 5 mai 2011, Greg Ewing <greg.ewing at canterbury.ac.nz> a écrit :
> Amaury Forgeot d'Arc wrote:
>
>
> It's in the file Doc/data/refcounts.dat
> in some custom format.
>
>
> However, it doesn't seem to quite convey the same information.
> It lists the "refcount effect" on each parameter, but translating
> that into the notion of borrowed or stolen references seems
> to require knowledge of what the function does.
>
> For example, PyDict_SetItem has:
>
> PyDict_SetItem:PyObject*:p:0:
> PyDict_SetItem:PyObject*:key:+1:
> PyDict_SetItem:PyObject*:val:+1:
>
> All of these parameters take borrowed references, but the
> key and val get incremented because they're being stored
> in the dict.

This is not always true, for example when the item is already present
in the dict.
It's not important to know what the function does to the object,
Only the action on the reference is relevant.

>
> So this file appears to be of limited usefulness.

-- 
Amaury

-- 
Amaury Forgeot d'Arc
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4