Annoying octal notation

Mensanator mensanator at aol.com
Fri Aug 21 13:36:35 EDT 2009


On Aug 21, 11:40 am, David <71da... at libero.it> wrote:
> Il Thu, 20 Aug 2009 15:18:35 -0700 (PDT), Mensanator ha scritto:
>
> > (Just kidding! That works in 2.5 also. How are you using it where
> > it's coming out wrong? I can see you pulling '012' out of a text
> > file and want to calculate with it, but how would you use a
> > string without using int()? Passing it to functions that allow
> > string representations of numbers?)
>
> Obviously it's not a progamming issue, just a hassle using the interpreter
> on command line.

Aha! Then I WAS right after all. Switch to 3.1 and you'll
soon be cured of that bad habit:

>>> 012 + 012
SyntaxError: invalid token (<pyshell#4>, line 1)


>
> David




More information about the Python-list mailing list