Old Man Yells At Cloud

Steve D'Aprano steve+python at pearwood.info
Thu Sep 21 11:12:09 EDT 2017


On Thu, 21 Sep 2017 08:19 pm, Rhodri James wrote:

> (That's basically my gripe against print becoming a function in Python3.
>   It makes a lot of sense as has already been pointed out, but it breaks
> every beginners tutorial.)

Nobody made that decision lightly. It wasn't a spur of the moment decision,
Guido didn't wake up one morning and say "Hey, how about we break a whole lot
of the Python ecosystem for giggles!" You can't fix mistakes without breaking
things that depend on those mistakes.

That's why a whole lot of backward-incompatible changes were queued up to 
all happen at once, to minimize the disruption:

- clean up the naming of the standard library;

- make strings proper text rather than bytes;

- fix print and exec;

- get rid of the old, error-prone "except Error, name" syntax;

- get rid of dangerous input and rename raw_input;

- make map and zip iterators;

- get rid of redundant range and rename xrange;

- make dict.keys, items and values views, instead of having three 
  sets of methods (lists, views and iterators);

- get rid of the confusing bytes.encode and str.decode methods;

and any others I missed.

If you think the transition from 2 to 3 was painful, you should consider how it
would have been to introduce all those backward incompatible changes in dribs
and drabs over 2.4, 2.5, 2.6, 2.7 and beyond.

The alternative would be to *not* remove the old versions, and just keep all the
old cruft and obsolete code hanging around forever.

And remember that the Python core developers feel your pain too. They had to
migrate a large code base (the Python std library) from 2 to 3. They had to
write the 2to3 translator. And they have to maintain two independent code
bases, 2 and 3, in parallel, for a decade or more, and put up with thousands of
internet haters going on and on and on and on about "Python 3 is destroying
Python", year after year after year.

They were willing to do all this because they were looking at the long-term
health of the Python language, not just the immediate situation.



-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.




More information about the Python-list mailing list