grab dict keys/values without iterating ?!

Mark Lawrence breamoreboy at yahoo.co.uk
Wed Dec 11 13:09:34 EST 2013


On 11/12/2013 17:19, Travis Griggs wrote:
>
> On Dec 11, 2013, at 5:31 AM, rusi <rustompmody at gmail.com> wrote:
>
>>
>> The classic data structure for this is the trie:
>> General idea: http://en.wikipedia.org/wiki/Trie
>> In python:
>> http://stackoverflow.com/questions/11015320/how-to-create-a-trie-in-python/
>
> My thoughts exactly!
>
> If you wade through the comments there, someone has done a more-than-naive implementation here:
>
> https://github.com/kmike/marisa-trie
>
> The write up makes it look pretty favorable as well for performance (scroll 2/3s down to the Benchmarks section).
>

http://kmike.ru/python-data-structures/ from the author of the above is 
well worth a read.

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

Mark Lawrence




More information about the Python-list mailing list