Inherting from object. Or not.

Nick Coghlan ncoghlan at iinet.net.au
Fri Jan 28 06:21:51 EST 2005


Nick Craig-Wood wrote:
> Nick Coghlan <ncoghlan at iinet.net.au> wrote:
> 
>> Exactly. My advice is to use new-style classes unless you have a
>> reason not to (if you're inheriting from a builtin type, then there
>> is no need to inherit from object as well - the builtin types
>> already have the correct basic type).
> 
> 
> Except for Exception!
> 
> Exception and anything that inherits from it is an old style class.

And 'classobj' is the correct basic type for an Exception, since, as you 
mentioned, new-style classes are currently unraisable :)

Cheers,
Nick.
I think there *is* work in progress to change that. . .

-- 
Nick Coghlan   |   ncoghlan at email.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://boredomandlaziness.skystorm.net



More information about the Python-list mailing list