Trouble with property
Ben Finney
bignose+hates-spam at benfinney.id.au
Mon Oct 23 23:23:18 EDT 2006
"Odalrick" <odalrick at hotmail.com> writes:
> Gabriel Genellina skrev:
>
> > You must use a new-style class for properties to work. That is:
> > class ConstrainedBox(object):
>
> Thank you, I've seen it mentioned, but never knew what it meant.
More generally, a "new-style class" is important in this instance
because it inherits, directly or indirectly, from a built-in type,
becoming part of the main class hierarchy.
There are very few reasons to use old-style classes these days (and I
don't know what those reasons are anymore). Avoid them unless you know
you want them for some specific reason.
--
\ "I got some new underwear the other day. Well, new to me." -- |
`\ Emo Philips |
_o__) |
Ben Finney
More information about the Python-list
mailing list