[issue17008] Descriptor __get__() invoke is bypassed in the class context

2013-01-21 Thread Benjamin Peterson
Benjamin Peterson added the comment: If you want to emulate classmethod, calling __get__() on the function is the wrong thing to do. f.__get__(None, X) -> f You need to create a bound yourself instead. -- nosy: +benjamin.peterson resolution: -> invalid status: open -> closed

[issue17008] Descriptor __get__() invoke is bypassed in the class context

2013-01-21 Thread stuart
New submission from stuart: I emulated a real classmethod using python: class cm(object): def __init__(self, o): self.o = o def __get__(self, obj, type=None): return self.o.__get__(obj, type) then I check whether it is workable in the interactive mode and it is working: