Why gives "k = 09" a syntax error ?

Steve Holden steve at holdenweb.com
Thu Oct 30 05:44:11 CET 2008

Cameron Laird wrote:
> 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.
They are also more likely to write

  chmod 330 file


  chmod ug=rw file

Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC              http://www.holdenweb.com/

More information about the Python-list mailing list