[Python-bugs-list] [ python-Bugs-495094 ] evaluating integers inconsistently
noreply@sourceforge.net
noreply@sourceforge.net
Wed, 19 Dec 2001 08:44:31 -0800
Bugs item #495094, was opened at 2001-12-19 08:44
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=495094&group_id=5470
Category: Python Interpreter Core
Group: Python 2.1.1
Status: Open
Resolution: None
Priority: 5
Submitted By: Fahri Basegmez (basegmez)
Assigned to: Nobody/Anonymous (nobody)
Summary: evaluating integers inconsistently
Initial Comment:
Python 2.1.1 (#20, Jul 20 2001, 01:19:29) [MSC 32 bit
(Intel)] on win32
Type "copyright", "credits" or "license" for more
information.
IDLE 0.8 -- press F1 for help
>>> eval('01234')
668
>>> for i in range(10):print eval('0' + str(i))
0
1
2
3
4
5
6
7
Traceback (most recent call last):
File "<pyshell#2>", line 1, in ?
for i in range(10):print eval('0' + str(i))
File "<string>", line 1
08
^
SyntaxError: unexpected EOF while parsing
>>> 08
SyntaxError: invalid syntax
>>> 01
1
>>> 0123456
42798
>>> 0123456L
42798L
>>>
eval function and Python interpreter evaluates
integers/long integers inconsistenly. It should be an
error either for all cases or for none.
Fahri Basegmez
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=495094&group_id=5470