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 veky
Recipients josh.r, mark.dickinson, pitrou, rhettinger, veky
Date 2016-09-20.05:23:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1474349002.69.0.841757961973.issue25478@psf.upfronthosting.co.za>
In-reply-to
Content
Operator seems OK. After all, we can currently do c+c, which is kinda like c*2 (sequences behave this way generally, and it is a usual convention in mathematics too). And division by a number is just a multiplication by its reciprocal. But a dedicated normalize method? No. As Josh said, then you're forking the API.

The correct way is probably to have a "normalized view" of a Counter. But I don't know the best way to calculate it fast. I mean, I know it mathematically (cache the sum of values and update it on every Counter update) but I don't know whether it's Pythonic enough.
History
Date User Action Args
2016-09-20 05:23:22vekysetrecipients: + veky, rhettinger, mark.dickinson, pitrou, josh.r
2016-09-20 05:23:22vekysetmessageid: <1474349002.69.0.841757961973.issue25478@psf.upfronthosting.co.za>
2016-09-20 05:23:22vekylinkissue25478 messages
2016-09-20 05:23:22vekycreate