Commonly-used names in the Python standard library

Chris Angelico rosuav at gmail.com
Thu Feb 20 08:34:27 EST 2014


On Thu, Feb 20, 2014 at 11:46 PM, Marko Rauhamaa <marko at pacujo.net> wrote:
>> And at some point, the new keywords must just become standard.
>
> That's an explicit program of destroying backwards-compatibility: a war
> on legacy code. That may be the Python way, but it's not a necessary
> strategy.
>
>> There's no point polluting every Python script forever with these
>> directives, and no point maintaining two branches of code in the
>> interpreter.
>
> Two branches? I would imagine there would be dozens of "branches" in the
> interpreter if the latest interpreter were to support all past Python
> dialects (as it should, IMO).

Indeed. If the interpreter were to include every dialect of "old
Python", then it would have a lot more than two branches. They would,
in fact, increase exponentially with every Python version.
Fortunately, there is an alternative. You can specify the version of
Python like this:

#!/usr/local/bin/python3.4

or any of several other ways. You then choose exactly which versions
of Python to have installed, and continue to use them for as long as
you wish. There's no reason for the 3.4 interpreter to be able to run
code "as if it were" the 3.1 interpreter, when you can just have the
3.1 interpreter itself right there.

ChrisA



More information about the Python-list mailing list