numpy NaN, not surviving pickle/unpickle?

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Mon Sep 14 04:50:35 EDT 2009


En Sun, 13 Sep 2009 20:53:26 -0300, Steven D'Aprano  
<steve at 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




More information about the Python-list mailing list