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

2009-01-09 Thread Grant Edwards
On 2009-01-09, Dennis Lee Bieber wrote: > On Thu, 08 Jan 2009 09:46:26 -0600, Grant Edwards > declaimed the following in comp.lang.python: > > >> Heathkit Z80 stuff used octal notation too. > > Octal worked well for the old 8080 and derivative processors as > there were only 7 registers and

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

2009-01-08 Thread Grant Edwards
On 2009-01-08, Bruno Desthuilliers wrote: > Grant Edwards a ?crit : >> On 2009-01-08, Alex van der Spek wrote: >> >>> Thanks much, that makes sense! >> >> Well, that's the correct explanation. >> >> Whether that feature makes sense or not is debatable. Even I'm >> not old-school enough that

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

2009-01-08 Thread Bruno Desthuilliers
Grant Edwards a écrit : On 2009-01-08, Alex van der Spek wrote: Thanks much, that makes sense! Well, that's the correct explanation. Whether that feature makes sense or not is debatable. Even I'm not old-school enough that I ever use octal literals -- and I used Unix on a PDP-11 for years

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

2009-01-08 Thread Terry Reedy
Alex van der Spek wrote: I can't think of anything that could cause this. Similarly, eval('09') fails, but for string 0x with x<8 it works. I am teaching myself Python in order to climb the ladder from Algol(1980s)-->Pascal(1990s)-- VisualBasic(2000)-->Python. I am a physicist, have programmed

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

2009-01-08 Thread Ned Deily
In article , Unknown wrote: > On 2009-01-08, Alex van der Spek 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

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

2009-01-08 Thread Alex van der Spek
Thanks much, that makes sense! Alex van der Spek -- http://mail.python.org/mailman/listinfo/python-list

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

2009-01-08 Thread Grant Edwards
On 2009-01-08, Alex van der Spek wrote: > Thanks much, that makes sense! Well, that's the correct explanation. Whether that feature makes sense or not is debatable. Even I'm not old-school enough that I ever use octal literals -- and I used Unix on a PDP-11 for years (actually had my own PDP-1

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

2009-01-08 Thread Mark Dickinson
On Jan 8, 9:31 am, Alex van der Spek wrote: > >>> eval('07') > 7 > >>> eval('08') > > Traceback (most recent call last): >   File "", line 1, in >     eval('08') >   File "", line 1 >     08 >      ^ > SyntaxError: invalid token An integer literal with a leading zero is interpreted as an octal

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

2009-01-08 Thread Thomas Guettler
Hi, 07 is octal. That's way 08 is invalid. Try this: ===> python >>> print 011 9 >>> print int('011') 11 -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- http://mail.python.org/mailman/listinfo/python-list