[Python-Dev] [Python-checkins] r64424 - in python/trunk:Include/object.h Lib/test/test_sys.py Misc/NEWSObjects/intobject.c Objects/longobject.c Objects/typeobject.cPython/bltinmodule.c

Raymond Hettinger python at rcn.com
Thu Jun 26 13:24:43 CEST 2008


From: "Guido van Rossum" <guido at python.org>
> I don't care about the details of the patch until we have agreement
> about which form the feature should take. We don't have that agreement
> yet.

Updated to the patch to address everyone's review comments:
       http://bugs.python.org/file10742/float8.diff

* Alexander Belopolsky requested exponential notation instead of potentially very long strings of bits.  Done

* Alexander Belopolsky requested  true mathematical radix 2 representation of a float rather than its 64-bit memory layout.  Done

* Antoine Pitrou requested that hex() and oct() be supported as well as bin().  Terry J. Reedy also requested support for hex(). 
Done.

* Alexander Belopolsky and Alexandre Vassalotti requested that the output be a two-way street -- something that can be round-tripped 
through eval().  Done.

* Amaury Forgeot d'Arc requested that the implementation not manipulate C strings inplace.  Fixed -- used  PyUnicode_FromFormat() 
instead.

* Amaury Forgeot d'Arc requested that tests should check if negative numbers have the same representation as their absolute value. 
Done.

* Mark Dickinson requested sign preserving output for bin(-0.0).  We couldn't find a clean way to do this without a special cased 
output format.

* Mark Dickinson reviewed the NaN/Inf handling.  Done.

* Eric Smith requested that the routine be attached to _PyFloat_to_base() instead of attaching to __bin__, __oct__, and __hex__. 
Done.

* Guido requested that the docs be updated. Done.

* Guido requested that the globally visible C API function name be prefixed with _Py.  Done.

* Mark Dickinson requested normalizing output to start with a 1 so that nearby values have similar reprs.  Done.


Raymond 



More information about the Python-Dev mailing list