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/111229.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 APIMark Shannon marks at dcs.gla.ac.uk
Fri May 6 12:45:38 CEST 2011
Antoine Pitrou wrote:
> On Fri, 06 May 2011 13:28:11 +1200
> Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> 
>> Amaury Forgeot d'Arc wrote [concerning the Doc/data/refcounts.dat file]:
>>
>>> 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.
>> Yes, that's the whole point. When using a functon,
>> what you need to know is whether it borrows or steals
>> a reference.
> 
> Doesn't "borrow" mean the same as "steal" in that context?
> If an API borrows a reference, I expect it to take it from me.

"Stealing" takes the ownership. Borrowing does not.

This explains it better:
http://docs.python.org/py3k/c-api/intro.html#reference-count-details

Cheers,
Mark.
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