Re: pickle and infinity

2006-11-30 Thread Bart Ogryczak
Grant Edwards wrote: > On 2006-11-29, Bart Ogryczak <[EMAIL PROTECTED]> wrote: > > > > Fredrik Lundh wrote: > >> Bart Ogryczak wrote: > >> > >> > I´ve got this problem with pickle, it seems it doesn´t handle > >> > correctly infinite values (nor does Python return overflow/underflow > >> > error).

Re: pickle and infinity

2006-11-29 Thread Grant Edwards
On 2006-11-29, Bart Ogryczak <[EMAIL PROTECTED]> wrote: > > Fredrik Lundh wrote: >> Bart Ogryczak wrote: >> >> > I´ve got this problem with pickle, it seems it doesn´t handle >> > correctly infinite values (nor does Python return overflow/underflow >> > error). >> >> Python 2.X relies on the C libr

Re: pickle and infinity

2006-11-29 Thread Bart Ogryczak
Fredrik Lundh wrote: > Bart Ogryczak wrote: > > > I´ve got this problem with pickle, it seems it doesn´t handle > > correctly infinite values (nor does Python return overflow/underflow > > error). > > Python 2.X relies on the C library to serialize floats, and, as you've > noticed, some C librarie

Re: pickle and infinity

2006-11-29 Thread Fredrik Lundh
Bart Ogryczak wrote: > I´ve got this problem with pickle, it seems it doesn´t handle > correctly infinite values (nor does Python return overflow/underflow > error). Python 2.X relies on the C library to serialize floats, and, as you've noticed, some C libraries can produce values that they them

Re: pickle and infinity

2006-11-29 Thread Grant Edwards
On 2006-11-29, Bart Ogryczak <[EMAIL PROTECTED]> wrote: > I´ve got this problem with pickle, it seems it doesn´t handle > correctly infinite values (nor does Python return > overflow/underflow error). What could I do about it? Here's what I did. I'm sure it'll fall down on some systems, but it w

Re: pickle and infinity

2006-11-29 Thread Bart Ogryczak
To make things more interesting -- Solaris version: >>> x = 1e310 >>> x Infinity >>> import pickle >>> pickle.dumps(x) 'FInfinity\n.' >>> pickle.loads(_) Infinity >>> pickle.dumps(x,1) [...] SystemError: frexp() result out of range -- http://mail.python.org/mailman/listinfo/python-list

pickle and infinity

2006-11-29 Thread Bart Ogryczak
Hello, I´ve got this problem with pickle, it seems it doesn´t handle correctly infinite values (nor does Python return overflow/underflow error). What could I do about it? Example code: >>> x = 1e310 #actually it would be a result of calculations >>> type(x) >>> x 1.#INF >>> import pickle >>> pic