On Thu, Feb 6, 2020 at 11:07 PM Jonathan Fine <jfine2...@gmail.com> wrote: > > SUMMARY > ========= > > It was once a good idea, for Python 3 to forbid leading zeroes in integer > literals. Since then circumstances have changed. Perhaps it's now, or soon > will be, a good time to permit this. > > So what's happening? Briefly, in Python 2.7 we have two forms with the same > meaning > > >>> 01, 010 > (1, 8) > >>> 0o1, 0o10 > (1, 8) > > or in other words 010 is an OCTAL integer literal. In Python3 this was > removed, and instead we have only: > > >>> 0o1, 0o10 > (1, 8) > >>> > >>> 0O1, 0O10 > (1, 8) >
IMO this isn't worth enabling. The chances of a subtle bug are too high. The usage of "leading zero means octal" exists in far too many languages, and if someone comes from one of those (or from Python 2) and tries something in Python 3, it's important to not create bizarrely incorrect behaviour; an immediate SyntaxError is safe. The proposed advantage, by comparison, is fairly minor. ChrisA _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/PZDBAMAMUXYJBVGFGVIKLCSUTNY55W4L/ Code of Conduct: http://python.org/psf/codeofconduct/