I just checked it myself to see what works and what doesn't. You're right that it doesn't work when putting '0x' in front of it. However, when I just do int('20', 16) it returns 32, which is correct.
It is a bit weird though, that int(hex(20), 16) returns an error and I think that should be fixed. The problem is I can't fix it ;). But I'm sure someone of the IronPython team will find some time to look into this bug (I think it can be classified as a bug, can't it?) and fix it. I think it is important that this will be fixed, because, as you said, there's a lot of code written by people in Python which uses this feature, who might migrate to IronPython.
Floris
On 10/9/06, Sanghyeon Seo <[EMAIL PROTECTED]> wrote:
>>> int('0x20', 16)
ValueError: invalid integer number literal
Same for long. Python library reference isn't clear on this point, but
my reading doesn't support this misfeature since one can use radix 0
to the same effect. Anyway, there are codes out there depending on
this. :(
--
Seo Sanghyeon
_______________________________________________
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
_______________________________________________ users mailing list users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com