Re: [Python-Dev] Re: marshal / unmarshal

2005-04-11 Thread Tim Peters
[Michael Hudson] > I've just submitted http://python.org/sf/1180995 which adds format > codes for binary marshalling of floats if version > 1, but it doesn't > quite have the effect I expected (see below): > >>> inf = 1e308*1e308 > >>> nan = inf/inf > >>> marshal.dumps(nan, 2) > Traceback (most re

Re: [Python-Dev] Re: marshal / unmarshal

2005-04-11 Thread Michael Hudson
I've just submitted http://python.org/sf/1180995 which adds format codes for binary marshalling of floats if version > 1, but it doesn't quite have the effect I expected (see below): >>> inf = 1e308*1e308 >>> nan = inf/inf >>> marshal.dumps(nan, 2) Traceback (most recent call last): File "", lin

Re: [Python-Dev] Re: Re: Re: marshal / unmarshal

2005-04-11 Thread Martin v. Löwis
Fredrik Lundh wrote: > I was under the impression that the marshal format has been stable for > quite a long time (people are using it for various RPC protocols, among > other things). I might be wrong. Python 2.4 introduced support for string sharing in marshal files, with an option to suppress

Re: [Python-Dev] New style classes and operator methods

2005-04-11 Thread Armin Rigo
Hi Greg, On Fri, Apr 08, 2005 at 05:03:42PM +1200, Greg Ewing wrote: > If the left and right operands are of the same class, > and the class implements a right operand method but > not a left operand method, the right operand method > is not called. Instead, two attempts are made to call > the lef

Re: [Python-Dev] Re: marshal / unmarshal

2005-04-11 Thread Tim Peters
... [mwh] > OK, so the worst that could happen here is that moving marshal data > from one box to another could turn one sort of NaN into another? Right. Assuming source and destination boxes both use 754 format, and the implementation adjusts endianess if necessary. Heh. I have a vague half-m

[Python-Dev] args attribute of Exception objects

2005-04-11 Thread Sébastien de Menten
Hi, When I need to make sense of a python exception, I often need to parse the string exception in order to retrieve the data. Example: try: print foo except NameError, e: print e.args symbol = e.args[0][17:-16] ==> ("NameError: name 'foo' is not defined", ) or try: (4).foo except Nam

Re: [Python-Dev] Re: marshal / unmarshal

2005-04-11 Thread Michael Hudson
Tim Peters <[EMAIL PROTECTED]> writes: > [Tim] >>> The 754 standard doesn't say anything about how the difference between >>> signaling and quiet NaNs is represented. So it's possible that a qNaN >>> on one box would "look like" an sNaN on a different box, and vice >>> versa. But since most peop

Re: [Python-Dev] Re: marshal / unmarshal

2005-04-11 Thread Tim Peters
[Tim] >> The 754 standard doesn't say anything about how the difference between >> signaling and quiet NaNs is represented. So it's possible that a qNaN >> on one box would "look like" an sNaN on a different box, and vice >> versa. But since most people run with all FPU traps disabled, and >> Pyt

Re: [Python-Dev] Re: marshal / unmarshal

2005-04-11 Thread Michael Hudson
Tim Peters <[EMAIL PROTECTED]> writes: > The 754 standard doesn't say anything about how the difference between > signaling and quiet NaNs is represented. So it's possible that a qNaN > on one box would "look like" an sNaN on a different box, and vice > versa. But since most people run with all

Re: [Python-Dev] Re: Re: Re: marshal / unmarshal

2005-04-11 Thread Bob Ippolito
On Apr 11, 2005, at 12:33 AM, Fredrik Lundh wrote: Tim Peters wrote: [Fredrik Lundh] is changing the marshal format really the right thing to do at this point? I don't see anything special about "this point" -- it's just sometime between 2.4.1 and 2.5a0. What do you have in mind? I was under the i

[Python-Dev] Re: Re: Re: marshal / unmarshal

2005-04-11 Thread Fredrik Lundh
Tim Peters wrote: > [Fredrik Lundh] >> is changing the marshal format really the right thing to do at this >> point? > > I don't see anything special about "this point" -- it's just sometime > between 2.4.1 and 2.5a0. What do you have in mind? I was under the impression that the marshal format ha