Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue3188] float('infinity') should be valid

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Jun 24, 2008, 3:47 AM

Post #1 of 2 (87 views)
Permalink
[issue3188] float('infinity') should be valid

New submission from Mark Dickinson <dickinsm[at]gmail.com>:

2.6 adds float('inf') and float('nan') as cross-platform ways to
generate infinities and NaNs. The C99 standard (section 7.20.1.3,
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.

----------
assignee: marketdickinson
files: infinity.patch
keywords: patch
messages: 68675
nosy: christian.heimes, marketdickinson
severity: normal
status: open
title: float('infinity') should be valid
type: behavior
versions: Python 2.6, Python 2.7, Python 3.0
Added file: http://bugs.python.org/file10716/infinity.patch

_______________________________________
Python tracker <report[at]bugs.python.org>
<http://bugs.python.org/issue3188>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 5, 2008, 8:23 AM

Post #2 of 2 (68 views)
Permalink
[issue3188] float('infinity') should be valid [In reply to]

Mark Dickinson <dickinsm[at]gmail.com> added the comment:

Checked in, r64729.

----------
resolution: -> accepted
status: open -> closed

_______________________________________
Python tracker <report[at]bugs.python.org>
<http://bugs.python.org/issue3188>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.