This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients docs@python, rhettinger, ukl
Date 2014-06-15.21:26:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1402867562.12.0.847839991856.issue21771@psf.upfronthosting.co.za>
In-reply-to
Content
There is a bit an inconsistency but it is more helpful than harmful most of the time.  The glossary defines a key-function which is used in a number of places such such as sorted(), min(), nsmallest() and others.  In all those cases, the parameter for the key-function is *key*.

It might feel "more consistent" to call it "key" everywhere, but that leaves out the explanation that *key* represents a key-function.

The other issue is that groupby() returns a (key, sub-iterator) pair where "key" is the result of key-function, not the key itself.

What we have now is imperfect but it does a reasonably good job helping people understand what the function does.  IMO, changing it to be "key" would make the docs less intelligible.

Thank you for the patch, but I'm going to pass on it.
History
Date User Action Args
2014-06-15 21:26:02rhettingersetrecipients: + rhettinger, docs@python, ukl
2014-06-15 21:26:02rhettingersetmessageid: <1402867562.12.0.847839991856.issue21771@psf.upfronthosting.co.za>
2014-06-15 21:26:02rhettingerlinkissue21771 messages
2014-06-15 21:26:01rhettingercreate