"Barry Scott" <barry.alan.scott@ntlworld.com> writes: > Why not store the key as part of the value. > > d[a] = a > > d[b] => a > > If you need more info in the value put a class instance or a > tuple with the key as part of the value. > > d[a] = (a,1) Ideally it would be nice not to have to store it as part of the value. But that should work. Thank you. I should have split my question clearly into two questions. Sorry for dragging the off [python-dev] topic aspect of my question into this list. The question I tried (poorly) to raise to this list is if a get_key(key) -> key as I described could be added to dictionary in future versions of python. I know at least one user that would use it :) Thank you from a happy python user, --eikeon
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4