3

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'>
kvivek
  • 3,321
  • 1
  • 15
  • 17

0 Answers0