Understanding properties
merman
merman at snafu.de
Sat Jul 6 14:05:18 EDT 2002
> >> class MyObject(object):
> >
> > Why it needs the inheritance from object - I don't understand.
>
> Backwards compatibility. To be precise, a class using properties
> needs to be new-style -- subclassing object is the simplest way
> to achieve this (there are quite a few others) -- because by
> default a class is a "classic" one, implementing exactly the
> same semantics as in Python 2.1 and older, ensuring no major code
> breakage in porting from 2.1 to 2.2 but constraining the applicability
> of the new features to classic classes.
Thanks Alex.
The last part of your description is a little bit unclear for me - I'm a
newbie.
Perhaps I will understand it in one year ;-).
Regards
Thomas
More information about the Python-list
mailing list