Question on metaclasses

Diez B. Roggisch deetsNOSPAM at web.de
Sun Apr 24 10:31:08 EDT 2005


> class Foo(type):
>     def __new__(cls, name, bases, dict):
> 
>         for k,v in [(k, v) for k,v in dict.items() if callable(v)]:
>             cls.wrap(k,v,cls.get_directives(v), dict)
> 
>         return super(Foo, self).__new__(self, name, bases, dict)

There is a confusion of self and cls above - rename self with cls.
-- 
Regards,

Diez B. Roggisch



More information about the Python-list mailing list