【发布时间】:2015-12-01 08:05:11
【问题描述】:
TypeError: 必须使用 JSONDecoder 实例作为第一个参数调用未绑定方法 decode()(改为获取 PrintJson 实例)
当我尝试将 python 对象解析为 json 时出现此错误。
使用以下代码:
import json
from json import JSONDecoder
class TestJson():
name = None
pass
printJson = PrintJson()
print printJson
print JSONDecoder.decode(printJson) // at this line, getting this error
【问题讨论】:
标签: python json python-2.7