[Python-checkins] r60039 - peps/trunk/pep-0754.txt
christian.heimes
python-checkins at python.org
Fri Jan 18 09:36:51 CET 2008
Author: christian.heimes
Date: Fri Jan 18 09:36:51 2008
New Revision: 60039
Modified:
peps/trunk/pep-0754.txt
Log:
Updated PEP 754 to mention the new Python 2.6 features.
Modified: peps/trunk/pep-0754.txt
==============================================================================
--- peps/trunk/pep-0754.txt (original)
+++ peps/trunk/pep-0754.txt Fri Jan 18 09:36:51 2008
@@ -17,6 +17,24 @@
This PEP has been rejected. After sitting open for four years, it has
failed to generate sufficient community interest.
+Several ideas of this PEP were implemented for Python 2.6. ``float('inf')``
+and ``repr(float('inf'))`` are now guaranteed to work on every supported
+platform with IEEE 754 semantics. However the ``eval(repr(float('inf')))``
+roundtrip is still not supported unless you define inf and nan yourself::
+
+ >>> inf = float('inf')
+ >>> inf, 1E400
+ (inf, inf)
+ >>> neginf = float('-inf')
+ >>> neginf, -1E400
+ (-inf, -inf)
+ >>> nan = float('nan')
+ >>> nan, inf * 0.
+ (nan, nan)
+
+The math and the sys module also have gained additional features,
+``sys.float_info``, ``math.isinf``, ``math.isnan``, ``math.copysign``.
+
Abstract
========
More information about the Python-checkins
mailing list