[Python-bugs-list] [ python-Bugs-620181 ] float('+ 0.0') fails

noreply@sourceforge.net noreply@sourceforge.net
Tue, 08 Oct 2002 09:02:43 -0700


Bugs item #620181, was opened at 2002-10-08 08:14
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=620181&group_id=5470

Category: Python Interpreter Core
Group: Python 2.2.2
Status: Open
Resolution: None
Priority: 2
Submitted By: Alexander Schmolck (aschmolck)
Assigned to: Nobody/Anonymous (nobody)
Summary: float('+ 0.0') fails

Initial Comment:
In [25]: int('+ 0')
Out[25]: 0

In [26]: float('+ 0.0')

ValueError: invalid literal for float(): + 0.0



----------------------------------------------------------------------

>Comment By: Tim Peters (tim_one)
Date: 2002-10-08 12:02

Message:
Logged In: YES 
user_id=31435

Why do you think this is a bug?  It's *generally* true that 
embedded whitespace isn't accepeted in numeric literals:

>>> int("2 3")
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ValueError: invalid literal for int(): 2 3
>>> import string
>>> string.atof("- 2")
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "C:\Code\python\lib\string.py", line 201, in atof
    return _float(s)
ValueError: invalid literal for float(): - 2
>>>

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=620181&group_id=5470