Python Gotcha with Octal Numbers

jmfbahciv at aol.com jmfbahciv at aol.com
Thu Feb 14 06:22:36 EST 2002


In article 
<2D484E1BB24678AC.1496996E81BD013F.73A9A3A001BEE345 at lp.airnews.net>,
   claird at starbase.neosoft.com (Cameron Laird) wrote:
>In article <130220020751360934%jwbaxter at spamcop.net>,
>John W. Baxter <jwbaxter at spamcop.net> wrote:
>			.
>			.
>			.
>>Did the elves at AT&T pick up the "leading 0 means octal" from
>>something earlier, or did they invent this stupidity themselves?
>			.
>			.
>			.
>OK, folks, how far back *can* we trace this?  My
>mind associates it with DEC systems, going back
>to the '60s, but I couldn't find any confirmation
>of that in a quick search.

You will never find a DEC standard that ever defined
a number with a leading zero to be octal.  I never
typed up anything that ever had that kind of standard. 

You must be confusing the character zero with the letter O.
In MACRO you could force the assembler to evaluate any
number by using a prefix:  ^D meant decimal; ^O meant octal.

/BAH

Subtract a hundred and four for e-mail.



More information about the Python-list mailing list