En Sun, 13 Sep 2009 20:53:26 -0300, Steven D'Aprano <st...@remove-this-cybersource.com.au> escribió:

There may be something to be said for caching "common" floats, like pi,
small integers (0.0, 1.0, 2.0, ...), 0.5, 0.25 and similar, but I doubt
the memory savings would be worth the extra complexity.

I've read some time ago, that simply caching 0.0 reduced appreciably the memory usage of a Zope application. (Note that Zope relies on pickling and unpickling objects all the time, so even if two objects started as the "same" zero, they may become different at a later time.)

--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to