Why is `object` an instance of `type` and `type` an instance of `object`?

前端 未结 3 695
温柔的废话
温柔的废话 2020-12-09 04:51

I am a little bit confused about the object and type classes in Python 3. Maybe someone can clear up my confusion or provide some additional inform

3条回答
  •  一个人的身影
    2020-12-09 05:38

    is the metaclass of class object, and every class (including type) has inherited directly or indirectly from object.

    If you need to find more about metaclasses chack out here https://realpython.com/python-metaclasses/

提交回复
热议问题