这是一个创建于 4473 天前的主题,其中的信息可能已经有所发展或是发生改变。
小弟最近需要从数据库里建一个twitter follower network.
研究了一下最后打算用linked list. 为了以后方便lookup以及调用就直接用pickle把这个data structure序列化到一个独立的文本,
但是pickle到70个node以上以后会遇到
RuntimeError: maximum recursion depth exceeded.
在网上查了一下是因为linked list 有node指向自己所以会导致serialization的时候产生recursion.
接下来用Jsonpickle试了一下,还是会有RuntimeError: maximum recursion depth exceeded while calling a Python object
有点迷茫,不知接下来应该怎么处理这个问题,各位有什么建议吗?第一次发帖求助 感谢
3 条回复 • 1970-01-01 08:00:00 +08:00
|
|
1
daqing 2012-07-25 19:54:14 +08:00
最简单的办法:自己遍历linked list,生成一个JSON数组。
|
|
|
2
reus 2012-07-25 22:54:35 +08:00
|
|
|
3
reus 2012-07-25 22:55:11 +08:00
|