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 davidcoallier
Recipients davidcoallier
Date 2013-01-18.12:24:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1358511873.97.0.161301766615.issue16994@psf.upfronthosting.co.za>
In-reply-to
Content
The `collections.Counter` library contains very useful methods for playing with dicts and sets (mainly the most_common()) function.

Even though it is fairly trivial to retrieve the least common elements in a Counter() by doing Counter(...).most_common(n)[:-n:-1] I believe that for the sake of consistency, the `least_common` method should also be available. 

The attached patch contains the following:
- The method definition in Lib/__init__.py to support least_common;
- The tests to make sure least_common behaves as expected;
- The documentation for 2.7 and the general documentation.

Everywhere `most_common` was mentioned, you will now find `least_common` mentioned as well.
History
Date User Action Args
2013-01-18 12:24:34davidcoalliersetrecipients: + davidcoallier
2013-01-18 12:24:33davidcoalliersetmessageid: <1358511873.97.0.161301766615.issue16994@psf.upfronthosting.co.za>
2013-01-18 12:24:33davidcoallierlinkissue16994 messages
2013-01-18 12:24:33davidcoalliercreate