[pypy-commit] pypy py3.6: Allow undescores in int() literals.

amauryfa pypy.commits at gmail.com
Wed Jan 3 17:54:57 EST 2018


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: py3.6
Changeset: r93622:ff9805f6a687
Date: 2018-01-03 22:51 +0100
http://bitbucket.org/pypy/pypy/changeset/ff9805f6a687/

Log:	Allow undescores in int() literals.

diff --git a/pypy/objspace/std/intobject.py b/pypy/objspace/std/intobject.py
--- a/pypy/objspace/std/intobject.py
+++ b/pypy/objspace/std/intobject.py
@@ -810,7 +810,7 @@
 
 def _string_to_int_or_long(space, w_inttype, w_source, string, base=10):
     try:
-        value = string_to_int(string, base)
+        value = string_to_int(string, base, allow_underscores=True)
     except ParseStringError as e:
         raise wrap_parsestringerror(space, e, w_source)
     except ParseStringOverflowError as e:


More information about the pypy-commit mailing list