The code shown in tutorial.rst is not the final one. There was some
discussion and the patch had to modified a bit. I've updated the
docs to reflect the final patch.
IIRC the index2 handling of the underlying tcl implementation was
somewhat confusing which let to this. But I am not sure, though. The
final patch was reviewed by 3 people, so it should be correct.
By now, this memory leak is fixed in Python 2.5 and after.
cheers,
robert