Add tests for cmp_to_key.

Adopt PEP 8 compliant function name.
Factor-out existing uses cmp_to_key.
Update documentation to use internal pointers instead of external resource.
This commit is contained in:
Raymond Hettinger 2010-04-04 21:45:01 +00:00
parent 4f185228b0
commit bb006cf26c
8 changed files with 17 additions and 31 deletions

View file

@ -76,7 +76,7 @@ def total_ordering(cls):
setattr(cls, opname, opfunc)
return cls
def CmpToKey(mycmp):
def cmp_to_key(mycmp):
'Convert a cmp= function into a key= function'
class K(object):
def __init__(self, obj, *args):