Message180189
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. |
|
Date |
User |
Action |
Args |
2013-01-18 12:24:34 | davidcoallier | set | recipients:
+ davidcoallier |
2013-01-18 12:24:33 | davidcoallier | set | messageid: <1358511873.97.0.161301766615.issue16994@psf.upfronthosting.co.za> |
2013-01-18 12:24:33 | davidcoallier | link | issue16994 messages |
2013-01-18 12:24:33 | davidcoallier | create | |
|