[Tutor] Why is an OrderedDict not sliceable?

Alan Gauld alan.gauld at btinternet.com
Thu Jan 21 19:12:18 EST 2016


On 22/01/16 00:00, Steven D'Aprano wrote:

> Also, you have a problem -- what happens if the incomplete postcode is 
> missing the first digit? (I suppose for that case, you just have to do a 
> slow linear search.) 

Which is why a different solution may be better suited.
What about an in-memory SQLite table? Then you can use
a LIKE based select and let the library do the hard work.

Just a thought.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list