Josh Cogliati <jjcogliati...@yahoo.com> added the comment:

Thank you for telling me about that function.  I read the documentation
on hex() and never realized that there was a second instance method
float.hex().  

I am curious why the proper way to turn a number into hex is the following:
import types

def to_hex(a):
    if type(a) == type(0.0):
        return a.hex()
    elif type(a) == type(1):
        return hex(a)
    else:
        raise TypeError('Must be int or float')



As in why does neither int.hex() or hex(float) work?

Thank you.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue7028>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to