Creating new types and invoking super

Arnaud Delobelle arnodel at googlemail.com
Thu Jan 24 08:19:43 CET 2008


On Jan 23, 11:51 pm, Arnaud Delobelle <arno... at googlemail.com> wrote:
Oops:

>
> class callsuper(object):
>     def __init__(self, f):
>         self.f = f
>     def __get__(self, obj, cls=None):
>         def newfunc(*args, **kwargs):
>             super(self.cls, obj).__init__()

Change this line to:
              getattr(super.cls, obj), self.f.__name__)()

>             return self.f(obj, *args, **kwargs)
>         return newfunc



More information about the Python-list mailing list