What is the purpose of subclassing the class “object” in Python?

前端 未结 6 2019
太阳男子
太阳男子 2020-11-30 05:15

All the Python built-ins are subclasses of object and I come across many user-defined classes which are too. Why? What is the purpose of the class object<

6条回答
  •  猫巷女王i
    2020-11-30 05:59

    Right, but it marks the class as a new-style class. Newly developed classes should use the object base because it costs little and future-proofs your code.

提交回复
热议问题