Python 2.7 / 3.1 introduced awesome collections.Counter.
collections.Counter
My question is: how do I calculate how many “elements” a counter has?
I want it:
len(list(counter.elements()))
But in short.
sum(counter.itervalues())