Re: Emulate @classmethod using decorator and descriptor

2006-12-12 Thread Gabriel Genellina
On 12 dic, 08:46, "WaterWalk" <[EMAIL PROTECTED]> wrote: > Hello, I was recently learning python decorator and descriptor and > emulated a @classmethod decorator: > class EmuClassMethod(object): > def __init__(self, f=None): > self.f = f > def __get__(self, obj, klass=None): >

Re: Emulate @classmethod using decorator and descriptor

2006-12-12 Thread Dustan
WaterWalk wrote: > Hello, I was recently learning python decorator and descriptor and > emulated a @classmethod decorator: > class EmuClassMethod(object): > def __init__(self, f=None): > self.f = f > def __get__(self, obj, klass=None): > if klass is None: >klass

Emulate @classmethod using decorator and descriptor

2006-12-12 Thread WaterWalk
Hello, I was recently learning python decorator and descriptor and emulated a @classmethod decorator: class EmuClassMethod(object): def __init__(self, f=None): self.f = f def __get__(self, obj, klass=None): if klass is None: klass = type(obj) def wrapped(