On Mon, 10 Oct 2005 20:37:03 +0100, Tom Anderson <[EMAIL PROTECTED]> wrote: > On Mon, 10 Oct 2005, it was written: ... >> There is no way you can avoid making garbage. Python conses everything, >> even integers (small positive ones are cached). > > So python doesn't use the old SmallTalk 80 SmallInteger hack, or similar?
If the SmallInteger hack is something like this, it does: >>> a = 42 >>> b = 42 >>> a is b True >>> a = 42000 >>> b = 42000 >>> a is b False >>> ... which I guess is what if referred to above as "small positive ones are cached". /Jorgen -- // Jorgen Grahn <jgrahn@ Ph'nglui mglw'nafh Cthulhu \X/ algonet.se> R'lyeh wgah'nagl fhtagn! -- http://mail.python.org/mailman/listinfo/python-list