Skip to main content

Various utility for handling loops, recursions, etc.

Project description

enveloop

PyPI version Build Status GitHub GitHub last commit

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


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)

Uploaded source

Built Distribution

enveloop-0.1.0-py3-none-any.whl (3.6 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page