class C: vs class C(object):

Aahz aahz at pythoncraft.com
Fri Jul 20 00:52:58 CEST 2007


In article <f7oplv$fn9$1 at zinnia.noc.ucla.edu>,
James Stroud  <jstroud at mbi.ucla.edu> wrote:
>Aahz wrote:
>> In article <pan.2007.07.19.08.09.59.261957 at REMOVE.THIS.cybersource.com.au>,
>> Steven D'Aprano  <steve at REMOVE.THIS.cybersource.com.au> 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)
>...

How is this broken?  Properties are not supported for old-style classes.
They may not support features introduced in new-style classes, but that's
hardly the same as "broken".
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

I support the RKAB



More information about the Python-list mailing list