Python 2.2 properties

Oleg Broytmann phd at phd.pp.ru
Tue Jan 15 13:33:40 EST 2002


On Tue, Jan 15, 2002 at 07:28:17PM +0100, Thomas Heller wrote:
> "Oleg Broytmann" <phd at phd.pp.ru> wrote in message news:mailman.1011116966.30282.python-list at python.org...
> > On Tue, Jan 15, 2002 at 09:43:56AM -0800, Mark McEahern wrote:
> > > "Note, to use property, your class must derive from object."
> >
> >    To use properties properly (pun! pun! :) your class must be new-style
> > class, but to create new-style class you don't need to be derived from
> > object. You can derive it from any new-style class (int, float, str, list,
> > dictionary...)
> 
> ...because these are derived from object!
> 
> >>> int.__bases__
> (<type 'object'>,)

   But you *don't must* to derive from object directly.

Oleg.
-- 
     Oleg Broytmann            http://phd.pp.ru/            phd at phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.




More information about the Python-list mailing list