Why type(Foo)
is different from type(Bar)
and type(foo)
is different from type(bar)
?
>>> class Foo: pass
...
>>> foo = Foo()
>>> class Bar(object): pass
...
>>> bar = Bar()
>>>
>>> type(Foo)
<type 'classobj'>
>>> type(foo)
<type 'instance'>
>>> type(Bar)
<type 'type'>
>>> type(bar)
<class '__main__.Bar'>