Re: [Tutor] two way dictionary

2007-11-28 Thread ingo janssen
On Nov 28, 2007 8:16 PM, Kent Johnson <[EMAIL PROTECTED]> wrote: > ingo janssen wrote: > > Is there a dict that works "both ways"? > > another implementation here: > http://www.radlogic.com/releases/two_way_dict.py > Perfect, never thought to actually search for 'two way dict'. Thanks Kent. Ingo

Re: [Tutor] two way dictionary

2007-11-28 Thread Kent Johnson
ingo janssen wrote: > Is there a dict that works "both ways"? Some discussion here: http://groups.google.com/group/comp.lang.python/tree/browse_frm/thread/c5ab5cf524a158be/2a4a941d55e011be?hl=en&rnum=1&_done=%2Fgroup%2Fcomp.lang.python%2Fbrowse_frm%2Fthread%2Fc5ab5cf524a158be%2F4c02e7b9c3b44c37%3F

[Tutor] two way dictionary

2007-11-28 Thread ingo janssen
for a little cherrypy app I'm working on I wrote the piece of code below. Goal is to obscure the first part of a directory path(s) the user is browsing. Replacing the first part of the path with an alias works fine, but for the application it has to work both ways. I know how to swap the keys and v