eval('07') works, eval('08') fails, why?

Ned Deily nad at acm.org
Thu Jan 8 12:56:11 EST 2009


In article <hNWdnZHtdblPgvvUnZ2dnUVZ_vzinZ2d at posted.visi>,
 Unknown <unknown at unknown.invalid> wrote:
> On 2009-01-08, Alex van der Spek <amvds at xs4all.nl> wrote:
> > Thanks much, that makes sense!
> Well, that's the correct explanation.
> Whether that feature makes sense or not is debatable.

The debate is over!  In Py 3.0, octal literals changed from 07 to 0o7; 
the old format gets an 'invalid token' parsing error.

-- 
 Ned Deily,
 nad at acm.org




More information about the Python-list mailing list