A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2007-November/075147.html below:

[Python-Dev] hex() and oct() still include the trailing L

[Python-Dev] hex() and oct() still include the trailing L - change this in 2.6? [Python-Dev] hex() and oct() still include the trailing L - change this in 2.6?Gregory P. Smith greg at krypto.org
Fri Nov 9 03:05:25 CET 2007
I thought the hell of stripping trailing Ls off of stringed numbers was gone
but it appears that the hex() and oct() builtins still leave the trailing
'L' on longs:

Python 2.6a0 (trunk:58846M, Nov  4 2007, 15:44:12)
[GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> x = 0xffffffffc10025be
>>> x
18446744072652596670L
>>> str(x)
'18446744072652596670'
>>> hex(x)
'0xffffffffc10025beL'
>>> '0x%x' % (x)
'0xffffffffc10025be'
>>> oct(x)
'01777777777770100022676L'

This appears to be fixed in py3k (as there is no longer an int/long to
distinguish).  Can we at least get rid of the annoying L in 2.6?

-gps
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-dev/attachments/20071108/a750ec67/attachment.htm 
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4