Christian Heimes wrote:
Steven D'Aprano wrote:
Not only don't I observe the same results as you, I'm afraid I can't even get your code to run. I get a SyntaxError from the funny quotes you're using: ´d.foo´ instead of 'd.foo' or "d.foo".
Kristján is using the old style and alternative syntax for repr(). Somehow the `` got screwed up by either his mailer or the mailing list. Don't be ashamed that you aren't aware of the alternative syntax. We keep it locked up in the cellar and it has been removed from the new, shiny Python 3 world.
I think it's actually some single quotes that got mangled by the mailer. Either way, something else is going on for Kristján to see such wildly different results between old-style and new-style attribute access, when the differences are in the noise for the other folks checking it. I was able to get the old-style class to be consistently faster by going back and trying the example on 2.4, but the change still wasn't even close to the dramatic difference Kristján is seeing. Kristján, is there a chance CCP optimised something in the old-style class attribute lookup code and didn't get around to submitting the patch back to python.org? Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia --------------------------------------------------------------- http://www.boredomandlaziness.org