Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #61592 > unrolled thread

Re: grab dict keys/values without iterating ?!

Started byMark Lawrence <breamoreboy@yahoo.co.uk>
First post2013-12-11 16:06 +0000
Last post2013-12-11 16:06 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: grab dict keys/values without iterating ?! Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-12-11 16:06 +0000

#61592 — Re: grab dict keys/values without iterating ?!

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2013-12-11 16:06 +0000
SubjectRe: grab dict keys/values without iterating ?!
Message-ID<mailman.3910.1386777997.18130.python-list@python.org>
On 11/12/2013 00:02, Tamer Higazi wrote:
> Hi people!
>
> Is there a way to get dict by search terms without iterating the entire
> dictionary ?!
>
> Let us assume I have:
>
> {'Amanda':'Power','Amaly':'Higgens','Joseph':'White','Arlington','Black','Arnold','Schwarzenegger'}
>
> I want to grab the dict's key and values started with 'Ar'...
>
> I could make an iterator and look if it's inside.
> I wasn't able to find it, but I am asking myself if dict has a builtin
> method to get me these key/values on the fly.
>
> Why do I ask you?! I am working with the ZODB Database, where I make use
> of a PersistentDict and PersistentList, and I want
>
>
> I would thank you for a short reply.
>
> Tamer

Plenty of answers already but this may be of interest 
http://stackoverflow.com/questions/2288901/best-data-structure-for-crossword-puzzle-search?lq=1

-- 
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.

Mark Lawrence

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web