Message79512
The counts/counter moniker emerged from the python-dev discussion and
I'm basically happy with it since the typical usage is c=Counter(myseq)
with no other non-dict accesses (mostly just c[elem]+=1 and print
c[elem]). It's a simple counter with a dict interface so the name
shouldn't suggest anything more complicated than that.
To me, MultiSet or CountingSet is too offputtingly computer-sciency and
misleadingly suggests a set-like API instead of a dict interface. I know
several programmers who don't know the terms, bag or multiset, but they
intuitively understand what a counter does. Am open to calling it a Bag
but I rather like the self-descriptiveness and simplicity of Counter.
As noted previously, standalone unittests are forthcoming (and a doc
patch). Wanted to get the API and sample use cases worked-out first.
Thanks for looking at the initial patch. |
|
Date |
User |
Action |
Args |
2009-01-09 21:36:46 | rhettinger | set | recipients:
+ rhettinger, gvanrossum, pitrou, bethard |
2009-01-09 21:36:45 | rhettinger | set | messageid: <1231537005.8.0.813817689101.issue1696199@psf.upfronthosting.co.za> |
2009-01-09 21:36:45 | rhettinger | link | issue1696199 messages |
2009-01-09 21:36:44 | rhettinger | create | |
|