On 25/02/17 17:24, Alan Gauld via Tutor wrote: >> If you don't know that you need to optimize then your >> time is usually better spent elsewhere. Dictionaries >> are pretty fast in Python and I'd suggest you try >> that first before shaving milliseconds in places >> that may not be where you need to make savings. > > Honestly, that method makes no sense to me whatsoever.
Sorry, what I meant is: try the simpler dictionary based technique first. Dictionaries are what Python uses internally for almost everything so they are very fast. Only if you know you need to improve on their performance should you try using other techniques (and that's an extremely rare scenario). -- 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 _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor