On 19 May 2005 12:20:03 -0700, rh0dium <[EMAIL PROTECTED]> wrote: > Python 2.3.5 (#1, Mar 20 2005, 20:38:20) > [GCC 3.3 20030304 (Apple Computer, Inc. build 1809)] on darwin > > Traceback (most recent call last): > File "<stdin>", line 1, in ? > NameError: name 'sorted' is not defined > > I think you're probably using 2.4 ??
Yes, sorted() is new in python 2.4 .You could use a very lightly tested pure-python partial replacement: def sorted(lst, **kwargs): l2 = lst[:] if kwargs.has_key('key'): f = kwargs['key'] l2.sort(lambda a,b: cmp(f(a), f(b))) return l2 l2.sort() return l2 And from your other email: > I need to go the other way! tuple2coord Sorry, I only go one way. It should be transparent how to do it backwards. Peace Bill Mill [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list