Backwards emulation rather than backwards compatibility?

Chris Barker Chris.Barker at noaa.gov
Tue May 28 17:15:41 EDT 2002


Christopher Browne wrote:
> Wouldn't it be easier to simply change the first line to:
> #!/usr/bin/python1.5

Only on *nix....

I'd love to see a platform independent way of doing this. Maybe all we
need to do is have the Python interpreter front-end look for that
classic *nix line, and then dispatch the script to the correct
interpreter for you. And have it work the same way on all platforms.

Yes, it's too late to have code like this in old scripts, but it only
gets worse with each new version. This was brought up two versions ago
(2.0). Also, while someone would have to go back and add a line to all
their old scripts, this is a whole lot less work than checking each for
incompatability with new features. OF course, that being said, RedHat
seems to be incapable of adding a "1.5" to all their config scripts, so
maybe there is more to it than I imagine.

All we need is a very simple dispatching front end, that looks for a key
at the top of the __main__ script, and invokes the correct interpreter.
A sysadmin could decide how many versions they want to support, but it
should be easy to have a half a dozen non each machine. This really is a
problem that needs to be addressed, and it just seems so easy!

-Chris




-- 
Christopher Barker, Ph.D.
Oceanographer
                                    		
NOAA/OR&R/HAZMAT         (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov



More information about the Python-list mailing list