3 Jan
2011
3 Jan
'11
10:18 p.m.
It seems to me that one of the more common reasons for using @property is to create a read-only attribute. I wonder if it would make sense to simply create a read-only decorator. Compare: class Foo(object): _size = 4 @property def size(self): return _size against: class Foo(object): @read-only size = 4 This gets more interesting if decorators nest: class Foo(object): __metaclass__ = abc.ABCMeta @abstract @classattribute @read-only size = None --rich