On 10/31/07, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote: > Guido van Rossum wrote: > > @property > > def encoding(self): > > return self._encoding > > > > @propset(encoding) > > def encoding(self, value=None): > > if value is not None: > > unicode("0", value) # Test it > > self._encoding = value > > That's reasonably nice, although I'm not sure about the > name "propset" -- it sounds like a repair kit for an > aircraft. Maybe something like "setproperty" would be > better. I'm open for a naming contest. > But there's something that bothers me about the whole > propery mechanism -- there's no straightforward way for > a property accessor to call the inherited version from > a base class. Isn't there? You can just use super() ISTR, though I haven't had the need myself and don't recall the exact syntax. -- --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4