A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-June/025044.html below:

[Python-Dev] d.get_key(key) -> key?

[Python-Dev] d.get_key(key) -> key? [Python-Dev] d.get_key(key) -> key?Daniel 'eikeon' Krech eikeon@eikeon.com
05 Jun 2002 18:41:12 -0400
"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