Class with Object as a parameter

前端 未结 6 1972
攒了一身酷
攒了一身酷 2020-12-22 17:23

I\'m trying to translate some python code to scala code. So I\'m a total noob in Python.

But why do some classes have object as a parameter but never explicitly use

6条回答
  •  梦毁少年i
    2020-12-22 17:55

    object is the most base type of class object defined in python. Attributes of object can be seen as below

    **>>> dir(object)

    ['class', 'delattr', 'doc', 'format', 'getattribute', 'hash', 'init', 'new', 'reduce', 'reduce_ex', 'repr', 'setattr', 'sizeof', 'str', 'subclasshook']**

    So Table(object) is just inheritance.!

提交回复
热议问题