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.
___
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
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?
No. That is how containers work. Look at PyBuild_Value() for
comparison.
None of these added references are
On Sunday 07 August 2005 22:14, Guido van Rossum wrote:
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.