On 3/17/07, Guido van Rossum <[EMAIL PROTECTED]> wrote:
> I'll take your word that 0X is popular for data files out there. I
> think I would support that in int(s, 0) but not in eval(s) -- IOW, hex
> literals in Python source code must start with 0x. After that they can
> use ABC or abc or AbC for all I care. I used Google's code search to
> find occurrences of 0X followed by a hex digit (and not preceded by a
> word character) and found only very few hits, many of which were false
> positives (e.g. in Python's own test suite there are a bunch of
> occurrences in string literals verifying that %#X produces the right
> output).

That's a tool I need to remember to learn to use.  I can't say that I
have seen lots of examples of 0XABC (although I have seen lots of
examples of 0ABCH in assembler), so if Google says it doesn't happen,
let's remove it.  As I pointed out, if someone has data with 0X in it,
it's a trivial one-liner to fix the data.

So, for input a hex number is a literal lower-case only "0x" followed
by hex digits in either upper or lower case, and for input, both "x"
and "X" are used, to indicate the case of the desired hex digits.

I think that makes for a much simpler explanation of the rules, which
means the breakage is not "gratuitous", and as you point out, the
conversion tool can easily cope with this.

Thanks,
Pat
_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to