metaclasses and performance

Mirko Dziadzka mirko-usenet-200706 at dziadzka.de
Thu Jun 21 05:27:39 EDT 2007


Lenard Lindstrom <len-l at telus.net>  wrote:
> I don't know if C asserts are active in release Python, but for 
> new-style classes one thing that happens during attribute lookup is that 
> an object's class is asserted to be an instance of type. 

Thank's for the explanation. My Linux distribution does not set NDEBUG
when compiling the python package so asserts are still in place.  A self
compiled python does not use the asserts and is 20% faster in my micro
benchmark.

    Mirko




More information about the Python-list mailing list