On Fri, Jun 29, 2018 at 11:25 PM, Guido van Rossum firstname.lastname@example.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 :-)
But in this case, I think there is more of an argument for a custom class -- if al it were was a dict with a custom constructor (and update) method, then yeah, better to have a function. But there is more tha could be built on top of a grouping class, one that happened to be a dict under the hod, but really s its own thing, with a handful of interfaces and methods that are specific to it.
More detail elsewhere in the discussion.