[Thomas Wouters] > I did the same narrowing-down last week, and submitted a patch to add > cycle-GC support to itertools.tee . It really needs it.
I agree. > Come to think of it, now that I remember how to properly do GC, I think > the patch cuts some corners, but it solved the problem. You mean because it didn't supply tp_clear? That's a funny one. Some people take pride in not supplying tp_clear unless it's absolutely necessary. For example, despite that tuples can be in cycles, the tuple type doesn't supply a tp_clear. This is "because" it's possible to prove that any cycle involving tuples must involve a non-tuple gc'ed type too, and that clearing the latter is always sufficient to break the cycles (which is all tp_clear _needs_ to do: we just need that the aggregate of all tp_clear slots that are implemented suffice to break all possible cycles). I never saw a point to that cleverness, though. It makes gc more obscure, and I'm not sure what it buys. Maybe the (typically teensy) bit of code needed to implement a tp_clear slot? That's all the (dubious) benefit I can think of. > Raymond is on it, anyway: > > http://python.org/sf/1444398 You found it, you fix it :-) _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com