[EMAIL PROTECTED] a écrit : > On Apr 17, 12:34 pm, Michael Torrie <[EMAIL PROTECTED]> wrote: >> Another thing to consider is that referencing a member of a class or >> instance already *is* a dictionary lookup. It's how python works. Thus >> dictionaries are optimized to be fast. Since strings are immutable, >> python hashes them into a fast lookup pointer. So every time you say >> mydict["mykey"], it already knows the lookup pointer (hash) for "mykey" >> (the string) and can find the dictionary entry very quickly, ideally in >> O(1) time (well maybe log(N)). Thus putting your headers in a >> dictionary is actually a really good idea for performance reasons. > > I didn't know about that, thanks. So after all the trouble I went > through writing those 200 loc I actually maid it worse...
That's an understatement. -- http://mail.python.org/mailman/listinfo/python-list