In Python 2.x there was a L
suffix after long integer. As Python 3 treats all integers as long integer this has been removed. From What's New In Python 3.0:
The repr() of a long integer doesn’t include the trailing L anymore, so code that unconditionally strips that character will chop off the last digit instead. (Use str() instead.)
From this I get that repr()
won't show L
suffix, but str()
will have the L
suffix. But in Python 3.3.3 none of them are showing L
suffix.
Python 3.3.3 (v3.3.3:c3896275c0f6, Nov 18 2013, 21:19:30) [MSC v.1600 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> repr(2 ** 64)
'18446744073709551616'
>>> str(2 ** 64)
'18446744073709551616'
Shouldn't the output of str()
be 18446744073709551616L
as per the doc? I could not find anything in What's New In Python 3.1, What's New In Python 3.2 and What's New In Python 3.3 that says L
suffix is removed from str()
too. 3.2 says that:
The str() of a float or complex number is now the same as its repr().
But it says nothing about integer.
From which version of Python L
suffix is removed in str()
too? Or am I missing something obvious?