【发布时间】:2016-07-20 20:14:57
【问题描述】:
我正在尝试将嵌套循环字典转换为 JSON。我收到溢出错误:
In [8]: xx = json.dumps(d)
---------------------------------------------------------------------------
OverflowError Traceback (most recent call last)
<ipython-input-8-95e57b3e2ca3> in <module>()
----> 1 xx = json.dumps(d)
OverflowError: Maximum recursion level reached
不知道为什么会发生这种情况,但我猜测它与我的字典以及它的结构有关。
【问题讨论】:
-
你是如何得到嵌套循环字典的?
-
嗯,我得到了一个带有循环字典的
ValueError。
标签: python json dictionary circular-dependency