Python complaints

Michael Hudson mwh21 at cam.ac.uk
Thu Nov 25 09:28:46 CET 1999


James Logajan <JamesL at Lugoj.Com> writes:

> Sorry, but I think the price paid for "true" GC is too high for the
> small number of programs that benefit from this. Perhaps one should
> learn to clean up after oneself when cycles are expected.

While I'm inclined to agree that the loss of simplicity accompanied by
inclusion of a true GC is too high a price to pay, "Perhaps one should
learn to clean up after oneself when cycles are expected" is a
ridiculous statement.

Suppose I want to represent some chain like structure where I can
reach any element from any other. This is not an outrageous request,
to my mind. Clearly the easiest solution is to use some kind of doubly
linked list, but the naïve implementation of this will lead to a
cyclic structure. So then either (a) you have to supply an explicit
.finalize() method or (b) you have to hack around mightily using
__getattr__ producing a solution that is slow and fragile. Neither of
these is at all satisfactory to my mind. Using DC's Aquisition classes
can help, but it's still an advanced technique that required to solve
a problem that looks incredibly simple.

Does anyone know if anything has come of that plan to have a rarely
running GC on dicts?

Regards,
Michael




More information about the Python-list mailing list