Using a method for a read-only object attribute is very clean in python.
class foo:
@property
def name(self):
return self._name
However, providing a setter method is somewhat ugly. Someone came up with an interesting workaround.
Using a method for a read-only object attribute is very clean in python.
class foo:
@property
def name(self):
return self._name
However, providing a setter method is somewhat ugly. Someone came up with an interesting workaround.
No comments yet.
RSS feed for comments on this post. TrackBack URI
Powered by WordPress