Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
duplicate key storing
#5
i think i was thinking about collections.Counter when i was thinking there was a way to work with multiple things with the same key.

i don't think defaultdict will help much since a list in a regular dictionary can accomplish this,

but multidict might be the thing. any documentation on multidict? i am wondering if md.add('foo',42) depends on 'foo' already being in there ... iow, do i have to do md['foo'] the first time. or was that coded just to show it could be added either way? maybe doing 2 one way and 2 the other way would show. will there be 4 instances of 'foo' keys in md?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
duplicate key storing - by Skaperen - Oct-02-2018, 04:42 AM
RE: duplicate key storing - by gruntfutuk - Oct-02-2018, 08:38 AM
RE: duplicate key storing - by snippsat - Oct-02-2018, 01:49 PM
RE: duplicate key storing - by DeaD_EyE - Oct-02-2018, 02:13 PM
RE: duplicate key storing - by Skaperen - Oct-03-2018, 01:46 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Taking user input and storing that to a variable then storing that variable to a list jowalk 12 37,430 Mar-27-2017, 11:45 PM
Last Post: wavic

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020