处理循环、递归等的各种实用程序。
enveloop的Python项目详细描述
enveloop
处理循环、递归等的各种实用程序。
限制递归次数
假设你写了一个递归函数,你想限制递归次数,只是为了无限循环自由,或者出于其他原因。
fromenveloopimportlimit_recursion_to# let's limit the number of recursion and after # the 10th recursion run a callback function@limit_recursion_to(number_of_loops=10,callback=lambdaarg:...)defmy_func(arg):...my_func(arg)...
更改日志
0.1.0
添加:
- 将递归限制为()