This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author bignose
Recipients bignose
Date 2016-03-05.23:58:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1457222316.54.0.23701049885.issue26490@psf.upfronthosting.co.za>
In-reply-to
Content
The language reference carves out a special case for decimal zero literals: they may have leading “0” digits. Non-zero decimal literals may not. This is apparently deliberate:

    Note that leading zeros in a non-zero decimal number are not allowed. This is for disambiguation with C-style octal literals, which Python used before version 3.0.

    reference/lexical_analysis.html#integer-literals

But the expressed rationale (“for disambiguation with C-style octal literals”) does not explain making decimal zero special compared with non-zero.

Is there a good reason for this inconsistency::

    0000    # valid syntax for zero literal
    0003    # SyntaxError
    0123    # SyntaxError

To my reading, they should all cause SyntaxError. What is the rationale for the special case of the first one?
History
Date User Action Args
2016-03-05 23:58:36bignosesetrecipients: + bignose
2016-03-05 23:58:36bignosesetmessageid: <1457222316.54.0.23701049885.issue26490@psf.upfronthosting.co.za>
2016-03-05 23:58:36bignoselinkissue26490 messages
2016-03-05 23:58:35bignosecreate