[Python-Dev] Should hex() yield 'L' suffix for long numbers?

Ka-Ping Yee python-dev at zesty.ca
Mon Jun 12 02:26:15 CEST 2006


I did this earlier:

    >>> hex(9999999999999)
    '0x9184e729fffL'

and found it a little jarring, because i feel there's been a general
trend toward getting rid of the 'L' suffix in Python.

Literal long integers don't need an L anymore; they're automatically
made into longs if the number is too big.  And while the repr() of
a long retains the L on the end, the str() of a long does not, and
i rather like that.

So i kind of expected that hex() would not include the L either.
I see its main job as just giving me the hex digits (in fact, for
Python 3000 i'd prefer even to drop the '0x' as well), and the L
seems superfluous and distracting.

What do you think?  Is Python 2.5 a reasonable time to drop this L?


-- ?!ng


More information about the Python-Dev mailing list