[Python-ideas] grouping / dict of lists

Chris Barker chris.barker at noaa.gov
Mon Jul 2 11:48:28 EDT 2018


On Fri, Jun 29, 2018 at 11:25 PM, Guido van Rossum <guido at 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 :-)

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.

-CHB

-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20180702/e031f941/attachment.html>


More information about the Python-ideas mailing list