This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: float('infinity') should be valid
Type: behavior Stage:
Components: Versions: Python 3.0, Python 2.7, Python 2.6
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: mark.dickinson Nosy List: christian.heimes, mark.dickinson
Priority: normal Keywords: patch

Created on 2008-06-24 10:47 by mark.dickinson, last changed 2022-04-11 14:56 by admin. This issue is now closed.

File name Uploaded Description Edit
infinity.patch mark.dickinson, 2008-06-24 10:47
Messages (2)
msg68675 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2008-06-24 10:47
2.6 adds float('inf') and float('nan') as cross-platform ways to 
generate infinities and NaNs.  The C99 standard (section, 
paragraph 3) specifies that 'infinity' (in any case, with optional 
preceding sign) should also be a valid input to strtod, and I propose 
that in Python float('infinity') should correspondingly be valid.

Note that the IEEE 754 standard also states that 'inf' and 'infinity' 
should be valid input string representations of infinity, and Python's 
decimal module also allows both 'inf' and 'infinity'.

A patch is attached.

Unless I'm mistaken, this change is simple and unlikely to be 
controversial.  I plan to check it in in a week or two if there's no 
feedback before then.
msg69281 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2008-07-05 15:23
Checked in, r64729.
Date User Action Args
2022-04-11 14:56:35adminsetgithub: 47438
2008-07-05 15:23:15mark.dickinsonsetstatus: open -> closed
resolution: accepted
messages: + msg69281
2008-06-24 10:47:34mark.dickinsoncreate