Inconsistency in hex()

Steven D'Aprano steve at
Tue Jul 12 13:17:07 CEST 2005

hex() of an int appears to return lowercase hex digits, and hex() of a
long uppercase.

>>> hex(75)
>>> hex(75*256**4)

By accident or design? Apart from the aesthetic value that lowercase hex
digits are ugly, should we care?

It would also be nice if that trailing L would disappear.


More information about the Python-list mailing list