Various utility for handling loops, recursions, etc.
Project description
enveloop
Various utilities for handling loops, recursions, etc.
Limit number of recursions
Let's say you wrote a recursive function and you want to limit number of recursions, just to be infinite loop free, or for any other reason.
from enveloop import limit_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=lambda arg: ...)
def my_func(arg):
...
my_func(arg)
...
Changelog
0.1.0
Added:
- limit_recursion_to()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
enveloop-0.1.0.tar.gz
(2.2 kB
view hashes)