On Wed, Oct 31, 2012 at 3:33 PM, Mark Lawrence <breamore...@yahoo.co.uk>wrote:
> Nope. I'm busy porting my own code from 2.7 to 3.3 and cmp seems to be > very dead. > > This doesn't help either. > > c:\Users\Mark\Cash\Python>**2to3.py > > Traceback (most recent call last): > File "C:\Python33\Tools\Scripts\**2to3.py", line 3, in <module> > from lib2to3.main import main > ImportError: No module named main > Perhaps you have a sys.path conflict? Use functools.cmp_to_key for porting cmp functions. "sort(x, my_cmp)" becomes "sort(x, key=cmp_to_key(my_cmp))" The cmp builtin is also gone. If you need it, the suggested replacement for "cmp(a, b)" is "(b < a) - (a < b)". Cheers, Ian
-- http://mail.python.org/mailman/listinfo/python-list