3

为什么type(Foo)不同type(Bar)type(foo)不同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'>
4

0 回答 0