Conversation:
Notices
-
Brett Slatkin ()'s status on Tuesday, 08-Jan-2013 18:44:00 EST Brett Slatkin
TIL: Python's @property has a short-hand for setters! class C(object): def __init__(self): self._x = None @property def x(self): """I'm the 'x' property.""" return self._x @x.setter def x(self, value): self._x = value @x.deleter def x(self): del self._x I was using Python 2.5 for so long I've been unaware of features introduce…