1

I don't know how to ask this question. But my mind was crashed when I try this,

In [18]: isinstance(object, type)
Out[18]: True

In [19]: isinstance(object, object)
Out[19]: True

In [20]: isinstance(type, object)
Out[20]: True

In [21]: isinstance(type, type)
Out[21]: True

I can explain some thing from above:

  1. object is a instance of type
  2. object is a instance of object
  3. type is a instance of object
  4. type is a instance of type

I don't know how to evaluate above concept. Please any one explain the above concept.

user2864740
  • 60,010
  • 15
  • 145
  • 220
dhana
  • 6,487
  • 4
  • 40
  • 63
  • This might be of interest to you: http://stackoverflow.com/questions/100003/what-is-a-metaclass-in-python/6581949#6581949; tl;dr version: It's because the function `type` is in fact a metaclass. `type` is the metaclass Python uses to create all classes behind the scenes. – metatoaster Mar 13 '14 at 10:26
  • @user2864740 If you understand my question description. Please change my question title related to that. – dhana Mar 13 '14 at 10:31
  • @dhana I did, and added a note for the original title was "false" :) `isinstance` "implies" a parent-child relationship, so parent-child/child-parent is a circular contradiction only, well, it is what it is here .. (Ruby has a similar self-tying knot at the root of the hierarchy.) – user2864740 Mar 13 '14 at 10:32
  • 1
    This might be useful: http://www.python.org/download/releases/2.2.3/descrintro/ – sanooj Mar 13 '14 at 10:33
  • @user2864740 thanks for edit. If you have any idea about my question. Please give me an answer. – dhana Mar 13 '14 at 10:34

0 Answers0