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
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com