您的位置:首页 > 其它

RuntimeError: maximum recursion depth exceeded in cmp

2016-01-31 13:09 218 查看
python默认的递归深度是很有限的,如果碰到类似的错误,先行设置一下吧。


sys.
setrecursionlimit
(limit)

Set the maximum depth of the Python interpreter stack to limit. This limit prevents infinite recursion from causing an overflow of the C stack and crashing Python.

The highest possible limit is platform-dependent. A user may need to set the limit higher when she has a program that requires deep recursion and a platform that supports a higher limit. This should be done with care, because a too-high limit can lead to a crash.

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: