[Python-3000] Does anyone remember the Red Hat 1.5->2.x fiasco?

Nick Coghlan ncoghlan at gmail.com
Mon Feb 4 23:01:18 CET 2008


Leif Walsh wrote:
> On Feb 4, 2008 2:34 PM, Neal Becker <ndbecker2 at gmail.com> wrote:
>> Would be even nicer if python could say:
>> require python_version >= x.y
>> or some such.
> 
> I already had this suggestion shot down in the "Namespaces are etc."
> thread.  The argument goes a bit like "if the os calls the wrong
> version of python to compile and run the code, it might not even
> compile, in which case the 'require version whatever' line of python
> code will never be executed".

Not only that, but applications which wish to provide a user-friendly 
error message when run with an incompatible version of the interpreter 
can already do so by checking sys.version_info in a main module that 
steps around the compilation issue by only using very limited constructs 
(more on that in my contribution to the namespaces thread).

This approach has the virtue of being able to give a nice error message 
with versions of the interpreter all the way back to 2.0 (when 
version_info was added) instead of relying on something that would at 
best be added in 2.6.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://www.boredomandlaziness.org


More information about the Python-3000 mailing list