Meador Inge <mead...@gmail.com> added the comment: It could be argued that this is a bug fix for 2.7. I find the current behavior odd at best since 'int' already accepts 'long' objects, but not the string representation of a 'long' object:
>>> sys.maxint 9223372036854775807 >>> sys.maxint + 1 9223372036854775808L >>> int(sys.maxint) 9223372036854775807 >>> int(sys.maxint + 1) 9223372036854775808L >>> int(9223372036854775807) 9223372036854775807 >>> int('9223372036854775807') 9223372036854775807 >>> int(9223372036854775808L) 9223372036854775808L >>> int('9223372036854775808L') Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: invalid literal for int() with base 10: '9223372036854775808L' >>> long('9223372036854775808L') 9223372036854775808L >>> int(1) 1 >>> int('1L') Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: invalid literal for int() with base 10: '1L' Let's discuss this a bit before closing it. What do others think? ---------- nosy: +meador.inge resolution: wont fix -> stage: committed/rejected -> needs patch status: closed -> open _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue15400> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com