making python scripts backwards compatible

Sean 'Shaleh' Perry shalehperry at attbi.com
Sat May 4 16:21:42 EDT 2002


On 04-May-2002 J.Jacob wrote:
> I would like to make a request.
> 
> Today I spent again some time converting python code.  It
> was in the SimpleXMLRPCServer.py file.  I wanted to use it
> remotely on another computer but it gave errors because of
> list comprehension and using the "".method() syntax
> instead of importing string.  The reason was that other
> computer was still running python 1.5.2.  I could not
> upgrade the remote computer (no root access) and even if i
> could the problem would come up soon again when the
> (mobile agent-)program relocated.
> 

I agree, it is quite annoying.

It is pretty easy to write a python script to catch a lot of this.  += and its
friends can be programmatically turned into a = a + .. same goes with string
methods.

list comprehensions however require human intervention.  A bigger problem is
the change in scope rules.

I find it particularly annoying that the python group makes this assumption we
are all running last week's python.  Not everyone owns the machine their
scripts run on.





More information about the Python-list mailing list