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.

classification
Title: Unusual way of doing 'Inf' in json library
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ezio.melotti Nosy List: ezio.melotti, mark.dickinson, python-dev, sbermeister
Priority: normal Keywords:

Created on 2012-05-21 22:39 by sbermeister, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (3)
msg161304 - (view) Author: Sasha B (sbermeister) Date: 2012-05-21 22:39
If you have a look at the file 'python/Lib/json/encode.py', on line 30 it says:

    # Assume this produces an infinity on all machines (probably not guaranteed)
    INFINITY = float('1e66666')
    FLOAT_REPR = repr

Isn't float('Inf') an accepted way of doing this? Should line 31 be INFINITY = float('Inf')?

Sasha
msg161306 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-05-21 23:54
New changeset c13066f752a8 by Ezio Melotti in branch '2.7':
#14875: Use float('inf') instead of float('1e66666') in the json module.
http://hg.python.org/cpython/rev/c13066f752a8

New changeset 06f21c6e0f2b by Ezio Melotti in branch '3.2':
#14875: Use float('inf') instead of float('1e66666') in the json module.
http://hg.python.org/cpython/rev/06f21c6e0f2b

New changeset f5f5db593d99 by Ezio Melotti in branch 'default':
#14875: merge with 3.2.
http://hg.python.org/cpython/rev/f5f5db593d99
msg161307 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2012-05-21 23:55
Fixed, thanks for the report!
History
Date User Action Args
2022-04-11 14:57:30adminsetgithub: 59080
2012-05-21 23:55:13ezio.melottisetstatus: open -> closed
resolution: fixed
messages: + msg161307

stage: resolved
2012-05-21 23:54:06python-devsetnosy: + python-dev
messages: + msg161306
2012-05-21 23:08:23ezio.melottisetassignee: ezio.melotti

type: enhancement -> behavior
nosy: + ezio.melotti
versions: + Python 3.2, Python 3.3
2012-05-21 22:59:36r.david.murraysetnosy: + mark.dickinson
2012-05-21 22:39:01sbermeistercreate