Rats! vararg assignments don't work

Alex Martelli aleax at mac.com
Wed May 30 11:05:43 EDT 2007


samwyse <dejanews at email.com> wrote:
   ...
> Actually, I'm surprised that the PEP does as much as it does.  If tuples
> are implemented as S-expressions, then something like this:

Tuples are implemented as compact arrays of pointer-to-PyObject (so are
lists, BTW).  So, for example, a 10-items tuple takes 40 bytes (plus a
small overhead for the header) on a 32-bit build, not 80 as it would if
implemented as a linked list of (pointer-to-object, pointer-to-next)
pairs; addressing sometuple[N] is O(1), NOT O(N); etc, etc.


Alex



More information about the Python-list mailing list