[Python-3000] [Python-ideas] Namespaces are one honking great idea -- let's do more of those!

Nick Coghlan ncoghlan at gmail.com
Wed Feb 6 12:09:11 CET 2008

Mike Meyer wrote:
> On Wed, 06 Feb 2008 01:01:05 +1000 Nick Coghlan <ncoghlan at gmail.com> wrote:
>> While I'm +1 on the idea of making altinstall the default for setup.py 
>> and the Windows installer (forcing the administrator to explicitly 
>> request that the new Python version be made the default Python 
>> installation for the machine), I'm a pretty strong -1 on officially 
>> blessing the idea of a python3 alias or a special py3 extension on 
>> Windows (end users are obviously free to create those if they want, of 
>> course).
> I like the python3 alias (and python2 in 2.X), because it moves us
> from a single default python to having a default python2 and python3,
> which means scripts that care can ask for that without breaking the
> ability to upgrade python2 or python3 without breaking those scripts,
> while still allowing the default python to be either python2 or
> python3.

The main objection I have is that the executable name is only part of 
the story - all of the PYTHON* environment variables may matter as well 
(there are 9 listed in python -h, and I would have to check the code to 
say with complete confidence that there aren't any others).

That said, while as a matter of purity I still think this is a platform 
problem (one which all current platforms I know of handle poorly ;), as 
a matter of practicality I'm seeing some benefits allowing a machine to 
have full fledged "Python 2" and "Python 3" setups side by side.

If Guido does decide to go the route of changing the interpreter binary 
to python3 (ala sqlite vs sqlite3), I would also suggest that we go the 
whole way and insert a '3' into all of the environment variable names 
that python3 looks for (PYTHON3PATH, PYTHON3STARTUP, etc). I'd even 
concede the utility of accepting the py3 extension on modules as a 
concession to extension based dispatching on Windows.

I still think it would be a bit of an ugly hack, but if it was followed 
through to the point of being able to define separate Python 2 & 3 
environments without the use of launch scripts (i.e. by changing the 
environment variable names as described above), maybe it would still be 
a worthwhile thing to do.


Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia

More information about the Python-3000 mailing list