Tuple slices

Jeff Epler jepler at unpythonic.net
Mon Jan 24 15:41:35 EST 2005

The cpython implementation stores tuples in memory like this:
    [common fields for all Python objects]
    [common fields for all variable-size python objects, including tuple size]
    [fields specific to tuple objects, if any]
    [array of PyObject*, one for each item in the tuple]
This way of storing variable-size Python objects was chosen in part
because it reuqires only one allocation for an object, not two.
However, there is no way for one tuple to point to a slice of another

there's no reason that some other python implementation couldn't make a
different choice.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20050124/b8b77416/attachment.sig>

More information about the Python-list mailing list