Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #93053
| From | Ben Finney <ben+python@benfinney.id.au> |
|---|---|
| Subject | Re: Looking up a dictionary _key_ by key? |
| Date | 2015-06-24 10:33 +1000 |
| References | <CAGGBd_pd9SA7SczanGARFr-+Z9SxP9Mkhfo-RivpcJLrnuexng@mail.gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1.1435106041.3674.python-list@python.org> (permalink) |
Dan Stromberg <drsalists@gmail.com> writes: > Is there a way of getting the key used by the dictionary, short of > storing a reference to it in the value, or using a second dictionary? The dictionary knows its keys and can provide them on request. Call the ‘dict.keys’ method to get them as a collection. -- \ “Capitalism has destroyed our belief in any effective power but | `\ that of self interest backed by force.” —George Bernard Shaw | _o__) | Ben Finney
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: Looking up a dictionary _key_ by key? Ben Finney <ben+python@benfinney.id.au> - 2015-06-24 10:33 +1000
csiph-web