Inilah pertanyaan murni desain khusus Python: class MyClass(object): ... def get_my_attr(self): ... def set_my_attr(self, value): ... dan class MyClass(object): ... @property def my_attr(self): ... @my_attr.setter def my_attr(self, value): ... Python memungkinkan kita...