why objects of old style classes are instances of 'object'
AlFire
spamgrinder.trylater at ggmail.com
Mon Apr 21 23:49:27 EDT 2008
Diez B. Roggisch wrote:
>
> But not everything is a newstyle-class:
>
>>>> class Foo: pass
> ...
>>>> isinstance(Foo, object)
> True
>>>> isinstance(Foo, type)
> False
>>>> class Bar(object): pass
> ...
>>>> isinstance(Bar, type)
> True
>>>>
>
thx for explanation. but more I look at it less and less I like the
notation of new-style-class definition. what is an added value of adding
"(object)" since it is already an object. Any insight?
Note: I am not a language purist, more a pragmatic who like a good style.
Andy
More information about the Python-list
mailing list