[Python-Dev] __getattr__ and new style classes

Nick Coghlan ncoghlan at gmail.com
Thu Oct 9 13:34:55 CEST 2008


Christian Heimes wrote:
> Nick Coghlan wrote:
>> 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 still think they are back ticks. Maybe the repr() function of new
> style classes is slower than the old style repr(). It might explain the
> difference.

Nope - if they were backticks, you'd either get a NameError (if d and d2
aren't defined in the scope where the timeit calls are being made), or
you'd end up timing the evaluation of some string literals.

Mailer issues aside though, we still don't know where that initial set
of strange numbers is coming from.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
            http://www.boredomandlaziness.org


More information about the Python-Dev mailing list