python - super (类型,obj): obj must be an instance or subtype of type

标签 python

为什么会出现以下错误,如何解决?

TypeError: super(type, obj): obj must be an instance or subtype of type

最佳答案

发生此错误的另一种方式是在 Jupiter 笔记本中使用类重新加载模块时。

简单的解决方法是重启内核。

http://thomas-cokelaer.info/blog/2011/09/382/

查看@Mike W 的answer了解更多详情。

关于python - super (类型,obj): obj must be an instance or subtype of type,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43751455/

相关文章:

python 包装

python - 用于搜索和导出到 csv 文件/Excel 表的 Shell 脚本

python - Python中sqlite数据输入的GUI界面

python - 对多行执行函数

python - Keras 逻辑回归在第一个纪元返回 nan

python - 根据正则表达式匹配替换数据框中的字符串值

Python 和 urllib2 : how to make a GET request with parameters

python - 在 Google Drive SDK 中使用实时更新方法的示例?

python - 从使用 python pandas 制作的数据透视表中进行过滤和选择

python - 我想用 Python 创建一个基本的属性系统(类和 def 语句)