[issue12127] Inconsistent leading zero treatment

Mark Dickinson report at bugs.python.org
Fri May 20 14:09:43 CEST 2011


Mark Dickinson <dickinsm at gmail.com> added the comment:

Well, I'd personally like to see those leading zeros accepted at some point in Python's future, for the sake of cleanliness and consistency.  Not just consistency with int(), but also e.g. with float literals:

>>> 0050.
50.0
>>> 0050
  File "<stdin>", line 1
    0050
       ^
SyntaxError: invalid token

I'm just not sure whether we're at that point yet.

I don't find the PEP 3127 argument that we should protect people from subsequent confusion in other languages with 'leading zero implies octal' semantics at all convincing.

On the other hand, I do see the case for not having Python 3 silently behave differently from Python 2.

It seems worth a discussion, at least.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12127>
_______________________________________


More information about the Python-bugs-list mailing list