Calling parent's __call__ method within class

落花浮王杯 提交于 2019-12-01 03:53:44

The super function takes the derived class as its first parameter, not the base class.

super(Person, self).__call__(someinfo)

If you need to use the base class, you can do it directly (but beware that this will break multiple inheritance, so you shouldn't do it unless you're sure that's what you want):

Parent.__call__(self, someinfo)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!