[issue8825] int("0",0) throws exception

Mark Dickinson report at bugs.python.org
Wed May 26 21:11:20 CEST 2010


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

Added some test cases in r81551 (trunk) and r81552 (release26-maint).

I'll merge these to py3k.  But I notice that the rules for py3k are a little odd:

>>> int('0000', 0)
0
>>> int('0001', 0)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: invalid literal for int() with base 0: '0001'

I expected the prohibition on leading zeros to apply to the first example, as well as the second.

----------

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


More information about the Python-bugs-list mailing list