Robert Bossy wrote:

> class Foo(Freezeable):
> def __init__(self):
> self.bar = 42
> self.freeze() # ok, we set all variables, no more from here
> 
> 
> x = Foo()
> print x.bar
> x.bar = -42
> print x.bar
> x.baz = "OMG! A typo!"
> 

Pretty nice, but unfortunately the subclass has to remember to call freeze
in it's init.  Too bad that can't be automated.


--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to