[Python-Dev] Pre-pre PEP for 'super' keyword

Delaney, Timothy (Tim) tdelaney at avaya.com
Mon May 7 00:34:52 CEST 2007


Steve Holden wrote:

> Tim Delaney wrote:
>> BTW, one of my test cases involves multiple super calls in the same
>> method - there is a *very* large performance improvement by
>> instantiating it once. 
>> 
> And how does speed deteriorate for methods with no uses of super at
> all (which will, I suspect, be in the majority)?

Zero - in those cases, no super instance is instantiated. There is a
small one-time cost when the class is constructed in the reference
implementation (due to the need to parse the bytecode to determine if if
'super' is used) but in the final implementation that information will
be gathered during compilation.

Tim Delaney


More information about the Python-Dev mailing list