Why PyINCREF on _PyFalseStruct and _PyTrueStruct?

Shiyao Ma i at introo.me
Wed Apr 8 11:41:48 EDT 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.

Regards.

-- 

吾輩は猫である。ホームーページはhttp://introo.me。



More information about the Python-list mailing list