Negative array indicies and slice()

Ian Kelly ian.g.kelly at gmail.com
Tue Oct 30 03:32:44 EDT 2012


On Mon, Oct 29, 2012 at 6:17 PM, Andrew Robinson
<andrew3 at r3dsolutions.com> wrote:
> If you re-check my post to chris, I listed the struct you mention.
> The C code is what is actually run (by GDB breakpoint test) when a tuple is
> instantiated.

When you were running GDB, were you debugging the interactive
interpreter or a precompiled script?  The interactive interpreter does
a compilation step for every line entered.

> If the tuple were stripped of the extra data -- then it ought to be as small
> as slice().
> But it's not as small -- so either the sys.getsizeof() is lying -- or the
> struct you mention is not complete.

As just explained, the extra 16 bytes are added by the garbage collector.



More information about the Python-list mailing list