Issue 934989: Strange behavior with '08' and '09' (original) (raw)
Issue934989
Created on 2004-04-14 15:01 by pyscal, last changed 2022-04-11 14:56 by admin. This issue is now closed.
Messages (3) | ||
---|---|---|
msg20503 - (view) | Author: Pascal (pyscal) | Date: 2004-04-14 15:01 |
>>> 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 "", line 1 00088200 ^ SyntaxError: invalid token | ||
msg20504 - (view) | Author: Sjoerd Mullender (sjoerd) * ![]() |
Date: 2004-04-14 15:20 |
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. | ||
msg20505 - (view) | Author: Walter Dörwald (doerwalter) * ![]() |
Date: 2004-04-14 15:21 |
Logged In: YES user_id=89016 This is not a bug: See http://docs.python.org/ref/integers.html for an explanation. Numbers starting with '0' are considered octal, and there is no digit '8' or '9' in octal. |
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-04-11 14:56:03 | admin | set | github: 40150 |
2004-04-14 15:01:47 | pyscal | create |