On Mon, Jul 2, 2018 at 8:49 AM Chris Barker <chris.bar...@noaa.gov> wrote:
> On Fri, Jun 29, 2018 at 11:25 PM, Guido van Rossum <gu...@python.org> > wrote: > > >> Hm, this actually feels heavier to me. But then again I never liked or >> understood the need for Counter -- >> > > actually, me neither -- and partly because it's too lightweight -- that > is, it's still a regular dict, and you pretty much have to know that to use > it. That it, it provides a nice counting constructor, but after that, it's > just a key:integer dict :-) > Counter provides ``most_common`` which is often implemented inefficiently if written from scratch. People mistakenly use ``sorted`` instead of ``heapq.nlargest``.
_______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/