<br><div><span class="gmail_quote">On 3/14/07, <b class="gmail_sendername">Raymond Hettinger</b> <<a href="mailto:python@rcn.com">python@rcn.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Now that the 20th century is safely behind us, do we still want literals with leading zeroes to be interpreted as octal?</blockquote><div><br>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.)
<br><br>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.)
<br> </div></div><br>(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.)
<br><br>-- <br>Thomas Wouters <<a href="mailto:thomas@python.org">thomas@python.org</a>><br><br>Hi! I'm a .signature virus! copy me into your .signature file to help me spread!