
July 24, 2007
12:07 a.m.
Ron Adam wrote:
property foo(): __value__ = value def __get__(): return __value__ def __set__(value) __value__ = value
The same object in a class might look like...
property foo(self): self.__value__ = None def __get__(self): return self.__value__ def __set__(self, value): self.__value__ = value
In the first version, how is anything supposed to know that the __value__ inside the function is an implicit attribute of self rather than a local variable of the function I can't see this flying, for all the reasons that suggestions for implicit 'self' in methods get shot down in milliseconds. -- Greg