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: 08 is invalid token in lists.
Type: Stage: resolved
Components: IDLE Versions: Python 2.6
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: Chris.Wright, tim.golden
Priority: normal Keywords:

Created on 2012-07-05 14:21 by Chris.Wright, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (2)
msg164681 - (view) Author: Chris Wright (Chris.Wright) Date: 2012-07-05 14:21
Python 2.6.6 tk 8.5
Idle 2.6.6

I was trying to generate a multidimensional list, and my test list kept giving errors highlighting 08 as an invalid token.

>>> cube = [[[01,02,03],[04,05,06],[07,08,09]],[[11,12,13],[14,15,16],[17,18,19]],[[21,22,3],[24,25,26],[27,28,29]]]
SyntaxError: invalid token
>>> cube = [[[01,02,03,04,05,06,07,08]]
SyntaxError: invalid token
>>> cube = [08]
SyntaxError: invalid token
msg164682 - (view) Author: Tim Golden (tim.golden) * (Python committer) Date: 2012-07-05 14:29
A "0" prefix to a number is taken by Python 2.x to introduce a series of octal (base 8) digits. You can't have 8 in base 8 so the number (and anything higher) is rejected.
History
Date User Action Args
2022-04-11 14:57:32adminsetgithub: 59459
2012-07-05 14:29:22tim.goldensetstatus: open -> closed
2012-07-05 14:29:14tim.goldensetnosy: + tim.golden
messages: + msg164682

resolution: rejected
stage: resolved
2012-07-05 14:21:54Chris.Wrightcreate