4 Jan
2011
4 Jan
'11
2:13 a.m.
On 1/3/2011 5:31 PM, Antoine Pitrou wrote:
On Mon, 03 Jan 2011 14:18:42 -0800 "K. Richard Pixley"
wrote: class Foo(object): @read-only size = 4
What's wrong with:
class Foo: ... @property ... def foo(self): ... return 4 ... Foo().foo 4 Foo().foo = 5 Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: can't set attribute
?
s/4/Bar()/:
class Foo: ... @property ... def foo(self): ... return Bar()
-- Scott Dial scott@scottdial.com scodial@cs.indiana.edu