Author DavidMertz
Recipients DavidMertz, josh.r, mark.dickinson, pitrou, rhettinger, veky, wolma
Date 2017-03-14.16:17:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I definitely wouldn't want a mutator that "normalized" counts for the reason Antoine mentions.  It would be a common error to normalize then continue meaningless counting.

One could write a `Frequency` subclass easily enough.  The essential feature in my mind would be to keep an attribute `` around to perform the normalization.  I'm +1 on adding that to `collections.Counter` itself.

I'm not sure if this would be better as an attribute kept directly or as a property that called `sum(self.values())` when accessed.  I believe that having `` would provide the right normalization in a clean API, and also expose easy access to other questions one would naturally ask (e.g. "How many observations were made?")
Date User Action Args
2017-03-14 16:17:46DavidMertzsetrecipients: + DavidMertz, rhettinger, mark.dickinson, pitrou, wolma, josh.r, veky
2017-03-14 16:17:46DavidMertzsetmessageid: <>
2017-03-14 16:17:46DavidMertzlinkissue25478 messages
2017-03-14 16:17:46DavidMertzcreate