[Python-ideas] Support floating-point values in collections.Counter

Joel Croteau jcroteau at gmail.com
Mon Dec 18 18:51:46 EST 2017


It would be useful in many scenarios for values in collections.Counter to
be allowed to be floating point. I know that Counter nominally emulates a
multiset, which would suggest only integer values, but in a more general
sense, it could be an accumulator of either floating point or integer data.
As near as I can tell, Collection already does support float values in both
Python 2.7 and 3.6, and the way the code is implemented, this change should
be a no-op. All that is required is to update the documentation to say
floating-point values are allowed, as it currently says only integers are
allowed.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20171218/85f1889c/attachment.html>


More information about the Python-ideas mailing list