[Python-ideas] Fwd: grouping / dict of lists

Chris Barker chris.barker at noaa.gov
Mon Jul 2 00:36:40 EDT 2018


On Sun, Jul 1, 2018 at 7:28 PM, David Mertz <mertz at gnosis.cx> wrote:

> But it's pretty simple. Whether my idea of collections.Grouping is adapted
> or whether a function/classmethod grouping() produces a plain dictionary,
>

or my custom class...


> the casting would be the same:
>
> {k:set(v) for k,v in deps.items()}
>
> {k:Counter(v) for k,v in deps.items()}
>

hmm, makes we wonder if it would make sense to update my implementation to
allow mapping types as well for the collection --now we'd be getting really
magic....

-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/20180701/50b6e7b5/attachment.html>


More information about the Python-ideas mailing list