reference counting for garbage collection
pinard at iro.umontreal.ca
Tue Dec 11 18:01:48 CET 2001
> It's arguably bad style to rely on objects going away as
> soon as they're no longer referenced, because if Python
> switches over completely to a "real" GC some time in the
> future then it will stop being true.
Arguably, yes! :-) :-)
As Alex pointed out, Jython does not use reference counting. A good while
ago, Tim Peters gave me confidence on the fact that Python is not going
to stop using reference counting, so it is reliable.
I did try both styles, and definitely for me, Python allows for much
cleaner and legible code. Writing for Jython requires a more verbose style,
and the added noise often goes against clarity.
Jython is close enough to Python so people may chose to either write for
both at once, at the price of often being less clean, or else, to later
revise code from Python to Jython if the need of Java specificities ever
arises; that should be rather easy, and I'll surely much welcome Jython
availability then. In the meantime, I much prefer the elegance of concision,
and beg to consider this good style. :-)
François Pinard http://www.iro.umontreal.ca/~pinard
More information about the Python-list