[Python-Dev] PyTuple_Pack added references undocumented

2005-08-07 Thread Edward C. Jones
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. ___

Re: [Python-Dev] PyTuple_Pack added references undocumented

2005-08-07 Thread Guido van Rossum
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

Re: [Python-Dev] PyTuple_Pack added references undocumented

2005-08-07 Thread Raymond Hettinger
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

Re: [Python-Dev] PyTuple_Pack added references undocumented

2005-08-07 Thread Fred L. Drake, Jr.
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.