Maintenance release? (Was RE: Variables different between .py and .pyc)
Carlos Ribeiro
cribeiro at mail.inet.com.br
Mon May 7 23:11:20 EDT 2001
At 20:49 07/05/01 -0400, Tim Peters wrote:
>[Scott Ransom]
> > My variables are truncated at ~12 decimal points of precision.
>
>Yup, and that's disgusting. This is apparently the cause:
>
> >>> eval(str(3.1415926535897931))
>3.1415926535900001
> >>>
>
>That is, marshal stores floats as strings after %.12g conversion (which is
>what str() uses). If Guido doesn't object, I'm going to change marshal to
>use repr() conversion instead (which uses %.17g conversion, which is enough
>digits to reproduce finite IEEE-754 doubles exactly, assuming high-quality
>platform C string<->double I/O).
I think that this may be a wonderful reason to build a maintenance release
of Python 2.1... Will this change break compatibility on the .pyc format,
or can it be done in a compatible way? If so, I think that a maintenance
build should be made (I know that you're not responsible for this, Tim, I'm
just raising the issue here...).
Carlos Ribeiro
More information about the Python-list
mailing list