On 8/7/05, Edward C. Jones <[EMAIL PROTECTED]> wrote:
> According to the source code, PyTuple_Pack returns a new reference (it
> calls PyTuple_New). It also Py_INCREF's all the objects in the new
> tuple. Is this unusual behavior? None of these added references are
> documented in the API Reference Manual.

This seems the only sensible behavior given what it does.

I think the INCREFs don't need to be documented because you don't have
to worry about them -- they follow the normal pattern of reference
counts: if you owned an object before passing it to PyTuple_Pack(),
you still own it afterwards.

The docs say that it returns a new object, so that's in order too.

It's not listed in refcounts.dat; that seems an omission (or perhaps
the function's varargs signature doesn't fit in the pattern?).

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
_______________________________________________
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

Reply via email to