descriptor
add a decorate function to a class
I have a decorated function (simplified version): class Memoize: def __init__(self, function): self.function = function[详细]
2022-12-23 17:29 分类:问答Who can call __get__, __set__ and __del__?
This is my code. I don\'t know why it doesn\'t work. class a: def __get__(self): return \'xxx\' def aa(self):[详细]
2022-12-14 13:41 分类:问答Use a Descriptor (EDIT: Not a single decorator) for multiple attributes?
Python 2.5.4. Fairly new to Python, brand new to decorators as of last night. If I have a class with multiple boolean attributes:[详细]
2022-12-11 04:47 分类:问答python attribute lookup without any descriptor magic?
I\'ve started to use the python descriptor protocol more extensively in the code I\'ve been writing.Typically, the default python lookup magic is what I want to happen, but sometimes I\'m finding I wa[详细]
2022-12-10 00:39 分类:问答
加载中,请稍侯......