Why PyINCREF on _PyFalseStruct and _PyTrueStruct?
i at introo.me
Wed Apr 8 17:41:48 CEST 2015
On Wed, Apr 8, 2015 at 11:24 AM, Ian Kelly <ian.g.kelly at gmail.com> wrote:
> The ref count is incremented because the caller will decrement it when
> it's done with the reference.
That makes sense.
To be generic, the caller won't check what the returned result is. It
just takes it as a normal PyObject. Traditionally, for functions like
above, the reference is assumed to be transferred to the caller.
More information about the Python-list