Python super() behavior not dependable

前端 未结 5 1737
逝去的感伤
逝去的感伤 2021-02-01 13:37

For some reason, the super() method is not always behaving as expected, opting to return:

TypeError(\'super(type, obj): obj must be an instance or          


        
5条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-01 14:21

    If you are using reload() as part of your workflow, you apparently need to also use super(self.__class__, self).__init__ for inheritance initialization.

    I suspect you will find this bug coincides with id(self.__class__) ==id(Retrieval) failing.

提交回复
热议问题