Why gives "k = 09" a syntax error ?

Cameron Laird claird at lairds.us
Wed Oct 29 17:17:02 EDT 2008


In article <6772c5db-cdcc-4f79-9a24-1da8e849c870 at 34g2000hsh.googlegroups.com>,
Mensanator  <mensanator at aol.com> wrote:
>On Oct 29, 2:44 pm, Stef Mientki <stef.mien... at gmail.com> wrote:
>> Guilherme Polo wrote:
>> > On 10/29/08, Stef Mientki <stef.mien... at gmail.com> wrote:
>>
>> >> hello,
>>
>> >>  Why gives "k = 09"  a syntax error ?
>>
>> > 09 is not a valid octal number. Instead use 011.
>>
>> > Ok, I guess you were not aware that prefixing a number with a '0'
>> > would cause python to parse it as an octal and now you know.
>>
>> thanks guys,
>> I didn't realize there were still people using octal notation ;-)
>
>Windows users don't have much need for it, but it's still
>popular with the 'Nix crowd.
			.
			.
			.
I contest that; my observation is that it's entirely an artifact
of legacy software, and regarded as no better than a distraction
by even the most narrow human 'Nixers, or the hardware types who
might at one time have found octal natural.  My own origins were
in hardware, Unix, and other DEC OSs, so I consider myself as
likely as anyone to think in octal--and I rarely do.

While I can't accept the "popular" part, I agree with you that
Unix people are at least more likely to recognize the 0-prefix.



More information about the Python-list mailing list