RuntimeError: maximum recursion depth exceeded in cmp
2016-01-31 13:09
218 查看
python默认的递归深度是很有限的,如果碰到类似的错误,先行设置一下吧。
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.
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.
相关文章推荐
- hdoj--2063--过山车(最大匹配)
- 模电补考计划
- iOS RunTime 运行时 介绍
- ActiveMQ持久化步骤
- Java NIO系列教程(十二) Java NIO与IO
- java编程排错技巧
- 技术杂记-改造具有监控功能的数据库连接池阿里Druid,支持simple-jndi,kettle
- 测试0131
- 初识less
- hdu 2136 Largest prime factor
- 单片机51c语言程序实例(可调控的跑马灯)+Proteus仿真+源代码
- 单片机51c语言程序实例(可调控的跑马灯)+Proteus仿真+源代码
- 杭电—竹青遍野
- Tomcat 启动都做了什么?
- 服务器稳定性测试方法汇总
- POJ 1860 - Currency Exchange
- 触发器
- 屏幕适配 swift纯中文翻译 响应式编程 环信 第三方IM聊天的SDK
- 504 Gateway Time-out
- AngularJS去掉的URL里的#号