Author r.david.murray
Recipients docs@python, ezio.melotti, r.david.murray, shreevatsa, vstinner
Date 2015-09-30.13:16:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Apparently that documentation is simply wrong.  The actual definition of what 'int' handles is *different* from what the parser handles.  I think that difference must constitute a bug (not just a doc bug), but I'm not sure if it is something that we want to fix (changing the parser).

I think the *operational* definition of int conversion for both is the same as for isdigit in python3 (  (The python2 docs just say '8 bit strings may be locale dependent', which means the same thing but is less precise).

>>> १२३४
  File "<stdin>", line 1
SyntaxError: invalid character in identifier
>>> int('१२३४')
>>> '१२३४'.isdigit()

The above behavior discrepancy doesn't apply to python2, since in python2 you can't use unicode in integer literals.

So, this is a bit of a mess :(.

The doc fix is simple: just replace the mention of integer literal with a link to isdigit, and fix the python2 isdigit docs to match python3's.
Date User Action Args
2015-09-30 13:16:34r.david.murraysetrecipients: + r.david.murray, vstinner, ezio.melotti, docs@python, shreevatsa
2015-09-30 13:16:34r.david.murraysetmessageid: <>
2015-09-30 13:16:34r.david.murraylinkissue25275 messages
2015-09-30 13:16:33r.david.murraycreate