Bruno Desthuilliers wrote: > here's an example using a property: > > class cpu_ports(object): > def __init__(self, value=0): > self._d = value > @apply > def value(): > def fset(self, value): > print 'vv' > self._d = value > def fget(self): > return self._d > return property(**locals()) > Wow! I've never seen properties written that way. Kind of takes all the mess out of what it usually is. Nice. BUT! I don't quite get the @apply-decorator here. The rest I get and so I gather what it is sort of kind of supposed to do. I have only found the depricated apply() function in the docs (which I also don't quite get just by scanning it). Is it that? If yes: How does it work? If not: What's going on there?
humbly ;) W -- http://mail.python.org/mailman/listinfo/python-list