Ethan Furman wrote:
Nick Coghlan wrote:
The update to the PEP that I just pushed actually drops class statement support altogether (at least for now), but if it was still there, the above example would instead look more like:
postdef x = property(class.get, class.set, class.delete) class scope: def get(self): return __class__.attr def set(self, val): __class__.attr = val def delete(self): del __class__.attr
I like Greg's proposal to use the throw-away name:
postdef x = property(scope.get, scope.set, scope.delete) class scope: def get(self): return __class__.attr def set(self, val): __class__.attr = val def delete(self): del __class__.attr
Oh, DRY violation... drat. ~Ethan~