Mercurial > magic
view Methods @ 141:dfeddf88bb85
created
| author | 127.0.0.1 |
|---|---|
| date | Sat, 29 Jun 2013 15:58:04 +0200 |
| parents | a7a67be0697c |
| children |
line wrap: on
line source
{{{#!python class UnboundMethod(object): def __init__(self, func): self.__func__ = func def __call__(self, *args, **kwargs): return self.__func__(*args, **kwargs) def __get__(self, instance, owner): return BoundMethod(instance, self.__func__) class BoundMethod(object): def __init__(self, instance, func): self.__self__, self.__func__ = instance, func def __call__(self, *args, **kwargs): return self.__func__(self.__self__, *args, **kwargs) }}}
