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.

相关文章:

  • 2022-02-25
  • 2021-07-21
  • 2021-12-20
  • 2021-04-27
  • 2022-12-23
  • 2021-05-09
  • 2021-12-21
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-02
  • 2022-12-23
相关资源
相似解决方案