[Python-ideas] Dict with inverse form

Nikolaus Rath Nikolaus at rath.org
Fri Feb 12 18:02:54 EST 2016


On Feb 12 2016, Chris Barker <chris.barker-32lpuo7BZBA at public.gmane.org> wrote:
> On Fri, Feb 12, 2016 at 12:27 PM, Andrew Barnert via Python-ideas <
> python-ideas-+ZN9ApsXKcEdnm+yROfE0A at public.gmane.org> wrote:
>
>> I look forward to it. Next time I need some variation of this, even if it
>> *isn't* the same variation you end up building, the fact that there's a
>> potential de facto standard for what to call the ".inv" or whatever still
>> helps me, right?
>>
>
> yeah, though I'm not sure I like that name... (can't think of a better one
> right now, though).

Are there use cases where the set of keys and the set of values is
overlapping?

In most cases you can probably get away by not offering an "inverse"
object at all, just let regular lookup fall back on value lookup.


Best,
-Nikolaus

(No Cc on replies please, I'm reading the list)
-- 
GPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F
Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

             »Time flies like an arrow, fruit flies like a Banana.«


More information about the Python-ideas mailing list