[ python-Bugs-934989 ] Strange behavior with '08' and '09'
SourceForge.net
noreply at sourceforge.net
Wed Apr 14 11:20:33 EDT 2004
Bugs item #934989, was opened at 2004-04-14 17:01
Message generated for change (Comment added) made by sjoerd
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=934989&group_id=5470
Category: Python Interpreter Core
>Group: Not a Bug
>Status: Closed
>Resolution: Invalid
Priority: 5
Submitted By: Pascal (pyscal)
Assigned to: Nobody/Anonymous (nobody)
Summary: Strange behavior with '08' and '09'
Initial Comment:
>>> 06
6
>>> 07
7
>>> 08
SyntaxError: invalid token
>>> 09
SyntaxError: invalid token
>>> eval('88200')
88200
>>> eval('00088200')
Traceback (most recent call last):
File "<pyshell#11>", line 1, in -toplevel-
eval('00088200')
File "<string>", line 1
00088200
^
SyntaxError: invalid token
----------------------------------------------------------------------
>Comment By: Sjoerd Mullender (sjoerd)
Date: 2004-04-14 17:20
Message:
Logged In: YES
user_id=43607
This is not a bug.
Numbers that start with digit 0 are interpreted as octal. 8
and 9 are not legal octal digits, so 08 and 09 are not legal
tokens.
See section 2.4.4 of the Python Language Reference.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=934989&group_id=5470
More information about the Python-bugs-list
mailing list