On 3/14/07, Raymond Hettinger <[EMAIL PROTECTED]> wrote:

Now that the 20th century is safely behind us, do we still want literals
with leading zeroes to be interpreted as octal?


What, this again? Without reading the rest of the thread I just know it'll
devolve into discussion about arbitrary-base-integer-literals :-) (Ok, I
snuck a peak just to make sure I won't get egg on my face.)

I'm -1 on removing octal and hexadecimal literals, as I do use them both,
and because of the fact that many, many other languages also use them. Some
things are just stumbling blocks. FWIW, we get a great many complete-newbie
questions on #python, and I do not believe I've *ever* seen anyone surprised
about octal literals. They're surprised about other representation issues,
like "€" coming out as "\xe2\x82\xac", every now and then about how to
handle 'binary literals' and occasionally about os.chmod(755) not doing the
right thing, but never about 010 coming out wrong. Oh, that's not entirely
true: once, someone complained that 0101110 didn't come out right, but the
problem wasn't the leading 0: he expected it to be interpreted as a binary
number and come out as 46, and was equally surprised by 1101110. (Boy, did
we have a hell of a time convincing that guy.)

(And no, I don't think the number of questions #python gets about binary
literals is enough to warrant binary literals. They're invariably new
programmers tackling the problem as an exercise, or trying to get at the
'pure bits' of an int to perform bitwise operations in an inefficient
manner.)

--
Thomas Wouters <[EMAIL PROTECTED]>

Hi! I'm a .signature virus! copy me into your .signature file to help me
spread!
_______________________________________________
Python-3000 mailing list
[email protected]
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