On 8/7/05, Edward C. Jones <edcjones at comcast.net> 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/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4