title: Python cannot handle numbers string starting with 0. Why?
body: <p>I just executed the following program on my python interpreter:</p>
  
  <pre><code>&gt;&gt;&gt; def mylife(x):
  ...     if x&gt;0:
  ...             print(x)
  ...     else:
  ...             print(-x)
  ... 
  &gt;&gt;&gt; mylife(01)
  File "&lt;stdin&gt;", line 1
  mylife(01)
          ^
  SyntaxError: invalid token
  &gt;&gt;&gt; mylife(1)
  1
  &gt;&gt;&gt; mylife(-1)
  1
  &gt;&gt;&gt; mylife(0)
  0
  </code></pre>
  
  <p>Now, I have seen <a href="https://stackoverflow.com/questions/11620151/what-do-numbers-starting-with-0-mean-in-python">this</a> but as the link says, the 0 for octal does not work any more in python (i.e. does not work in python3). But does that not mean that the the behaviour for numbers starting with 0 should be interpreted properly? Either in base-2 or in normal base-10 representation? Since it is not so, why does python behave like that? Is it an implementation issue? Or is it a semantic issue? </p>