> What would this mythical block statement look like that would make > properties easier to write than the above late-binding or the subclass > Property recipe? I suppose something like: class C(object): x = prop: """ Yay for property x! """ def __get__(self): return self._x def __set__(self, value): self._x = x and then: def prop(@block): return property( fget=block.get("__get__"), fset=block.get("__set__"), fdel=block.get("__delete__"), doc=block.get("__doc__", ""), ) (where "@bargs" would be the syntax to refer to block args as a dict, the same way "**kargs" already exist)
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