This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients pitrou, stw
Date 2012-05-23.16:26:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1337790202.3354.41.camel@localhost.localdomain>
In-reply-to <1337790159.95.0.721831498272.issue14775@psf.upfronthosting.co.za>
Content
Le mercredi 23 mai 2012 à 16:22 +0000, stw a écrit :
> So the tuple is linked-in to the garbage collection list before its
> contents are constructed?

It is. It typically happens when you do (in C code):

PyObject *my_tuple = PyTuple_New(2);
/* compute some_object ... */
PyTuple_SET_ITEM(my_tuple, 0, some_object);
/* compute some_other_object ... */
PyTuple_SET_ITEM(my_tuple, 1, some_other_object);

> Could tuples not be untracked at creation time then, or do not enough
> survive to gc to make this worthwhile?

The latter. Also, tuples are created at a high rate in the interpreter,
so it can actually decrease performance.
History
Date User Action Args
2012-05-23 16:26:05pitrousetrecipients: + pitrou, stw
2012-05-23 16:26:04pitroulinkissue14775 messages
2012-05-23 16:26:04pitroucreate