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/111195.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 APIGreg Ewing greg.ewing at canterbury.ac.nz
Thu May 5 00:04:51 CEST 2011
Mark Shannon wrote:

> The online documentation specifies which API function borrow and/or 
> steal references (as opposed to the default behaviour).
> Yet, I cannot find this information anywhere in the source.

There are comments in some places, e.g. in listobject.h:

   *** WARNING *** PyList_SetItem does not increment the new item's reference
   count, but does decrement the reference count of the item it replaces,
   if not nil.  It does *decrement* the reference count if it is *not*
   inserted in the list.  Similarly, PyList_GetItem does not increment the
   returned item's reference count.

If you're looking for evidence in the actual code, there's
nothing particular to look for -- it's implicit in the
way the function works overall.

-- 
Greg
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