In article <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> wrote: >Andre Meyer: >> >> Is the test meaningful and are you surprised by the results? >> I am, actually, because I would have assumed that attribute access >> with an object should be faster because lookup can be precompiled. > >The results seem okay. Python is a dynamic language, object attributes >(and methods, etc) are kept inside a dict, where you can add and remove >them when you like. So using a dict is faster. >You can also take a look at __slots__
Taking a look at __slots__ is fine as long as you don't actually use them. -- Aahz ([EMAIL PROTECTED]) <*> http://www.pythoncraft.com/ "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." --Brian W. Kernighan -- http://mail.python.org/mailman/listinfo/python-list