[Python-Dev] Borrowed and Stolen References in API

Greg Ewing greg.ewing at canterbury.ac.nz
Fri May 6 03:28:11 CEST 2011


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.

But this file *doesn't tell* you that -- rather it
assigns either 0 or +1 to a borrowed reference,
apparently based on some notion of what the function
"usually" does with that parameter.

There does not seem to be enough information in that
file to work out the borrowed/stolen statuses, which
makes it seem rather useless.

-- 
Greg


More information about the Python-Dev mailing list