On Feb 25, 2:40 pm, Joseph Turian <[EMAIL PROTECTED]> wrote: > I was given code that was written for python 2.5, and uses simple > functions like 'all' which are not present in 2.4 > > I want to make the code 2.4 compatible. What is the best way to do > this? > If I define function 'all', then won't I break 2.5 compatability? > > Thanks, > Joseph
See http://docs.python.org/lib/built-in-funcs.html which shows the current built-ins for Python. It also shows an equivalent function for all() that should work in 2.4. You can do a check at the beginning of your file by importing the sys module. Something like this: <code> # untested import sys version = sys.version.split(' ')[0] if '2.5' not in version: # use custom all() script </code> HTH Mike -- http://mail.python.org/mailman/listinfo/python-list