Class with Object as a parameter

前端 未结 6 1968
攒了一身酷
攒了一身酷 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条回答
  •  情话喂你
    2020-12-22 17:29

    1)Class name (object): 2) class name: They both are same but first one quite better in terms of writing,it look better while inheriting other classes to another,i t looks homogeneous.

    How same ? So,every thing in Python is come under object means every thing in Python has property of object,if write or don't it will understand it. In first we explicitly tell it in second we didn't.

提交回复
热议问题