Backwards emulation rather than backwards compatibility?

John Roth johnroth at ameritech.net
Sun May 26 08:30:33 EDT 2002


"Chris Liechti" <cliechti at gmx.net> wrote in message
news:Xns921A11F2F5EE8cliechtigmxnet at 62.2.16.82...
> Tim Churches <tchur at optushome.com.au> wrote in
> news:mailman.1022364102.10713.python-list at python.org:
> ...
> > But Martin v. Loewis points out:
> >> ...It is easy enough to install multiple
> >> versions of the interpreter, though.
> >
> > Indeed it is (unlike many other languages which make having
> > multiple versions installed a nightmare), and these days the
> > extra disc space used by multiple installations is not a concern.
So...
> >
> > How about a Python meta-bytecode-compiler/interpreter which examines
> > Python source code and/or bytecode and automatically sends the code
to
> > the appropriate installed version of Python, resetting PYTHONPATH
and
> > any other aspects of the environment appropriately?
> >
> > Parsing the entire source and trying to infer which version of
Python is
> > appropriate would probably be too slow (and a big job to write...),
> > so maybe an #ifdef-style directive could be put at the top of each
> > Python script which triggers the appropriate behaviour, such as
> >
> > import __v1.5.2__
> >
> > The module __v1.5.2__ would do nothing, but that line in the source
> > would direct the meta-Python to use the correct version.
> >
> > I'm not sure how such a meta-interpreter would deal with already
> > compiled
> > bytecode - is there a version stamp in the bytecode?
> >
> > If someone wants to write such a thing, I'd be happy to help test
it...
>
> that idea might sound nice, but it's too late! the problem are _old_
> scripts that nobody wants to touch and so there is no possibility to
> include such an import statement (and even add a empty _v*_.py file to
> satisfy the import). for the same reason a "from __past__ import x" is
> useless. if an old script needs python 1.5.2, just change the first
line to
> #/usr/bin/env python15 (on unix, windows in an other
plagu^H^H^H^Hroblem)

More FUD. The fact that nobody wants to touch them doesn't
mean that nobody will touch them. What it means is that people
generally don't want to make changes because they were written
in an opaque manner, without clear objectives. That has nothing
to do with a mechanical addition of a first line.

John Roth






More information about the Python-list mailing list