holger krekel <pyth@devel.trillke.net> writes: > IMO none of the new syntax ideas really have much appeal. I have the same feeling. > > One way to define lightweight properties today is something like > > foo = property( > lambda s: s.__dict__.get('_foo_', 42), > lambda s,x: s.__dict__.__setitem__('_foo_', x), > lambda s: s.__dict__.__delitem__('_foo_'), > "foo property" > ) and this is something I actually have done, for readonly computed properties (without docstring), where this is reduced to foo = property(lambda self: self._bar) All in all, I'm not so unhappy with the current way. Thomas
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