Why gives "k = 09" a syntax error ?

Robert Kern robert.kern at gmail.com
Wed Oct 29 17:57:53 EDT 2008


Mensanator wrote:
> On Oct 29, 4:25 pm, Terry Reedy <tjre... at udel.edu> wrote:
>> Stef Mientki wrote:
>>> hello,
>>> Why gives "k = 09"  a syntax error ?
>> You have gotten the 2.x answer.  In 3.0, 0b,0o,0x prefixes are valid and
>> required for binary, octal, and hexadecimal literals.  0digits is invalid.
>>
>> tjr
> 
> Is it documented? :-)

Yes.

http://www.python.org/dev/peps/pep-3127/

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco




More information about the Python-list mailing list