Georg Brandl wrote: > Nick Maclaren wrote: > >>In article <[EMAIL PROTECTED]>, >>Robert Kern <[EMAIL PROTECTED]> writes: >>|> Nick Maclaren wrote: >>|> > The way that I read it, Python allows only values (and hence types) >>|> > to be immutable, and not class members. The nearest approach to the >>|> > latter is to use the name hiding conventions. >>|> > >>|> > Is that correct? >>|> >>|> You can also make properties that don't allow writing. >>|> >>|> class Foo(object): >>|> >>|> def __init__(self, bar): >>|> self._bar = bar >>|> >>|> @property >>|> def bar(self): >>|> return self._bar >> >>Thanks very much. And, what's more, I have even found its documentation! >>Whatsnew2.2. The 2.4.2 reference is, er, unhelpful. > > > Is it? > > http://docs.python.org/lib/built-in-funcs.html > > documents "property" quite well. > I can't really agree that "quite good" documentation doesn't refer to the use of property as a decorator. It's obvious that a ncessary upgrade to the docs didn't happen (and we can all understand why, I am sure).
regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Love me, love my blog http://holdenweb.blogspot.com Recent Ramblings http://del.icio.us/steve.holden -- http://mail.python.org/mailman/listinfo/python-list