Comment #240

Kaushal Modi wrote the following reply to https://scripter.co/golang-quirk-number-strings-starting-with-0-are-octals/:

@Anonymous

> You may want to try something like this with Python .. print 017

You are correct, though that was true only in Python 2.x.

Thankfully you now need to use the `0o` or `0O` prefix for octal literals in Python 3.x. Someone wrote [PEP 3127](https://www.python.org/dev/peps/pep-3127/#abstract) for exactly the same confusion I went through in this post. The integer casting works as expected (`int("017") -> 17`) in Python 2.x and 3.x though.

Reply to this comment