On Oct 31, 2007, at 4:28 PM, Guido van Rossum wrote: > Given how rarely supporting deletions matters enough to write extra > code, we can just say that *when using @propset* your setter function > needs to have a default value for the argument or otherwise support > being called with one or two arguments.
It's definitely unusual, but the logic is typically very different; conflating the method in Python doesn't really feel "right" to me. I've been using Philipp von Weitershausen's "rwproperty" quite happily: http://pypi.python.org/pypi/rwproperty/ It uses the names "getproperty", "setproperty", and "delproperty", which feel reasonable when I use them (always referenced using the module), like so: class Thing(object): @rwproperty.setproperty def attribute(self, value): # ... If I had to choose built-in names, though, I'd prefer "property", "propset", "propdel". Another possibility that seems reasonable (perhaps a bit better) would be: class Thing(object): @property def attribute(self): return 42 @property.set def attribute(self, value): self._ignored = value @property.delete def attribute(self): pass -Fred -- Fred Drake <fdrake at acm.org> _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com