[Python-3000] Fwd: Re: Octal

Patrick Maupin pmaupin at gmail.com
Wed Mar 14 22:19:39 CET 2007


On 3/14/07, Thomas Wouters <thomas at python.org> wrote:
> On 3/14/07, Steven Bethard <steven.bethard at gmail.com> wrote:
> > Sorry, but could you explain why having the -py3k flag raise the
> > exception for your 2.X code wouldn't be sufficient?  Is it because you
> > expect your fingers will continue to type 0660 instead of 0t660 when
> > you're writing Python 3000 code?
>
> Not just me. The world. This isn't a "re-educate people used to a wart in
> Python 2.x" kind of thing. This is a "re-educate new programmers coming from
> other languages" kind of thing. The stuff we warn about with -Wpy3k in
> Python 2.6 is stuff that is a change in how Python 3.0 does things compared
> to 2.x. This isn't just a change compared to 2.6, this is a change compared
> to quite a lot of popular programming languages out there.

I absolutely agree with Thomas about this problem and this issue, but
I would like to additionally address the idea of "fixing" things with
a -py3k flag.  Many (most) Python programmers will not migrate all of
their stuff to 3.0 overnight.  They will be working on 2.x and 3.x
stuff for years, so the idea of "fix the code once and then forget
about it" does not address the fact that a human working in two
different environments will invariably screw up in one or the other
occasionally.

I understand that the floodgates are open on 3.0 and all sorts of
stuff is changing and being added and deleted, but (except for things
that are irretrievably broken), changes should not be made in such a
fashion that code will silently do different things on 2.6 and 3.0.
(Guido has explicitly addressed this in policy about the C API.)

Now, lots of things might be considered "irretrievably broken" by
those with deep experience and knowledge in the matter, but (with the
possible exception of Raymond) I have not seen anybody argue that "the
refusal of Python to parse a literal string of multiple digits with a
leading 0 as a decimal number is irretrievably broken."

The point that Raymond has made that I (and several others) can agree
with is "Python's parsing of a literal string of multiple digits with
a leading 0 as an octal number can be confusing to someone who
expected a decimal number."

But this latter problem can be fixed without silently doing something
different in 2.6 and 3.0, namely by refusing to guess whether the
number should be octal or decimal.

Regards,
pat


More information about the Python-3000 mailing list