Why make objects “callable” using magic methods instead of calling from object.property?

后端 未结 0 594
旧时难觅i
旧时难觅i 2021-02-07 02:57

I\'m going through a tutorial that defines the len and getitem methods to get an object\'s length and index respectively.

class          


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题