[Python-Dev] iterzip()

Martin v. Loewis martin@v.loewis.de
30 Apr 2002 08:45:56 +0200

Tim Peters <tim.one@comcast.net> writes:

> Half of a shadow of an idea:  at least in my code, it's common to have
> gazillions of tuples, and they almost always contain just strings and
> numbers.  Since they're immutable, they'll never contain anything else.  So
> they could get unlinked from cyclic gc entirely without ill effect (it's not
> possible that they could ever be in a cycle).  Perhaps a gen2 collection
> could learn something about this and automagically untrack them.

That could happen in gen0 already: when traversing an object, watch
whether it contains any tracked objects. If it doesn't, invoke
tp_is_immutable, if that returns true, untrack it.