Aahz wrote: > In article <[EMAIL PROTECTED]>, > Steven D'Aprano <[EMAIL PROTECTED]> wrote: > >>It isn't wrong to use the old style, but it is deprecated, [...] > > > Really? Can you point to some official documentation for this? AFAIK, > new-style classes still have not been integrated into the standard > documentation. Maybe I missed something, though. > > Note very carefully that "going away eventually" is *not* the same as > deprecation.
How about "broke" instead of "deprecated": >>> class Old: ... def __init__(self): ... self._value = 'broke' ... value = property(lambda self: self._value) ... >>> >>> class New(object): ... def __init__(self): ... self._value = 'works' ... value = property(lambda self: self._value) ... >>> broke = Old() >>> broke.value 'broke' >>> broke.value = 'still broke' >>> broke.value 'still broke' >>> >>> works = New() >>> works.value 'works' >>> works.value = 'expected result of assignment here' Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: can't set attribute James -- James Stroud UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 90095 http://www.jamesstroud.com/ -- http://mail.python.org/mailman/listinfo/python-list