[issue11707] Create C version of functools.cmp_to_key()

Raymond Hettinger report at bugs.python.org
Tue Apr 5 12:54:27 CEST 2011


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

> functools_cmp_to_key() doesn't 
> check that the argument is a callable.

I don't think that is necessary; it will fail with a TypeError when the attempt is made to call it.  This is the approach we take elsewhere (look at the built-in filter() function for example).

That being said, if you really think the early check is necessary, feel free to check it in.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11707>
_______________________________________


More information about the Python-bugs-list mailing list