class C: vs class C(object):

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

In article <f7oplv$fn9$1 at>,
James Stroud  <jstroud at> wrote:
>Aahz wrote:
>> In article <pan.2007. at>,
>> Steven D'Aprano  <steve at> 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           <*>

I support the RKAB

More information about the Python-list mailing list