[Python-3000] Metaclasses in Py3K (original) (raw)

Greg Ewing greg.ewing at canterbury.ac.nz
Wed Dec 13 01:01:31 CET 2006


Phillip J. Eby wrote:

At 11:07 AM 12/12/2006 -0800, Thomas Wouters wrote:

I do wonder why classes don't use fast locals, though.

Probably because (a) class creation is rarely a speed bottleneck in any program, and (b) by using a dict you end up with it already in the right form for passing to the class constructor.

def somefunc(anob, whatever): ...

class Foo: somefunc = somefunc Wouldn't work any more if you switched to fast locals.

Which wouldn't be a huge loss, since you can always rename the function to something different outside the class.

-- Greg



More information about the Python-3000 mailing list