[docs] [issue22830] functools.cmp_to_key: misleading key function description

Terry J. Reedy report at bugs.python.org
Sun Nov 9 19:18:28 CET 2014


New submission from Terry J. Reedy:

https://docs.python.org/3.4/library/functools.html#functools.cmp_to_key says " A key function is a callable that accepts one argument and returns another value indicating the position in the desired collation sequence."  A python list poster (Veek M) 'value indicating the position' as meaning 0, 1, 2, ... and I would read it that way if I did not know better.

Entries for min() and max() say "The key argument specifies a one-argument ordering function like that used for list.sort()."  This would be reused here.  We also, now, have a Glossary entry for 'key function'.  This could be referred to instead.

----------
assignee: docs at python
components: Documentation
messages: 230895
nosy: docs at python, terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: functools.cmp_to_key: misleading key function description
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5

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


More information about the docs mailing list