What are new-style classes?
Steve Holden
steve at holdenweb.com
Sun Aug 28 09:50:30 EDT 2005
Vaibhav wrote:
> I recently heard about 'new-style classes'. I am very sorry if this
> sounds like a newbie question, but what are they? I checked the Python
> Manual but did not find anything conclusive. Could someone please
> enlighten me? Thanks!
>
Older Pythons have a dichotomy between programmer-declared object
classes (from which subclasses can inherit) and the built-in object
classes (which just existed as built-in, but which could not be used as
the base of subclasses).
More recently the object hierarchy was redesigned, and now everything
inherits from object, so (if you know what you are doing) you can
implement subclasses of the built-in types such as dict, float and str.
Robert Kern has given you a link that explains the situation in detail.
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/
More information about the Python-list
mailing list