[issue7028] hex function should work with floats

2009-10-01 Thread Josh Cogliati
Josh Cogliati added the comment: Okay. Thank you. I looked at the issue 3008 discussion. I see why hex() was not changed. Can int.hex() and int.fromhex() be added for symmetry? I am willing to work on the patch, it just might be a bit. As well, either way, it might be useful for the documen

[issue7028] hex function should work with floats

2009-10-01 Thread Mark Dickinson
Mark Dickinson added the comment: Josh, see the issue 3008 discussion. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Uns

[issue7028] hex function should work with floats

2009-10-01 Thread Josh Cogliati
Josh Cogliati 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):

[issue7028] hex function should work with floats

2009-10-01 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- status: pending -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://

[issue7028] hex function should work with floats

2009-10-01 Thread Mark Dickinson
Changes by Mark Dickinson : -- status: open -> pending ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://ma

[issue7028] hex function should work with floats

2009-10-01 Thread Mark Dickinson
Mark Dickinson added the comment: > I agree it would be useful. That's why this facility already exists Ahem. Embarrassing causation fail. To clarify, Raymond Hettinger proposed this addition some time ago, and others on python-dev supported it. *That's* why it was implemented. :) --

[issue7028] hex function should work with floats

2009-10-01 Thread Mark Dickinson
Mark Dickinson added the comment: I agree it would be useful. That's why this facility already exists in Python >= 2.6 (including Python 3.x). :-) Python 2.6.2 (r262:71600, Jul 8 2009, 09:56:31) [GCC 4.0.1 (Apple Inc. build 5490)] on darwin Type "help", "copyright", "credits" or "license"

[issue7028] hex function should work with floats

2009-09-30 Thread Josh Cogliati
Changes by Josh Cogliati : -- type: -> feature request ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://m

[issue7028] hex function should work with floats

2009-09-30 Thread Josh Cogliati
New submission from Josh Cogliati : The hex() builtin function only takes integers. Also there is no way to create a floating point number from a hexadecimal string. However it would often be useful to be able to see the hexadecimal version of an float since this is an exact representation as c