Annoying octal notation

John Nagle nagle at animats.com
Fri Aug 21 19:45:51 CEST 2009


Simon Forman wrote:
> On Aug 20, 3:06 pm, David <71da... at libero.it> wrote:
>> Hi all,
>>
>> Is there some magic to make the 2.x CPython interpreter to ignore the
>> annoying octal notation?
> 
> No.  You would have to modify and recompile the interpreter. This is
> not exactly trivial, see "How to Change Python's Grammar"
> http://www.python.org/dev/peps/pep-0306/
> 
> However, see "Integer Literal Support and Syntax" http://www.python.org/dev/peps/pep-3127/
> 
> (Basically in 2.6 and onwards you can use 0oNNN notation.)

     Yes, and making lead zeros an error as suggested in PEP 3127 is a good idea.
It will be interesting to see what bugs that flushes out.

     In 2009, Unisys finally exited the mainframe hardware business, and the
last of the 36-bit machines, the ClearPath servers, are being phased out.
That line of machines goes back to the UNIVAC 2200 series, and the UNIVAC
1100 series, all the way back to the vacuum-tube UNIVAC 1103 from 1952.
It's the longest running series of computers in history, and code for all
those machines used octal heavily.

     And it's over.  We can finally dispense with octal by default.

					John Nagle



More information about the Python-list mailing list