Skip to main content

Decorator that increase the stack size for a function

Project description

Description

This decorator increases the stack size for the function and its recursion limit. The function runs in a separated thread with a stack size specified by the stacksize parameter (default: 128MiB). Also the recursion limit can be modified by the recursionlimit parameter (default: 1M), but be aware that this is a variable shared by the whole python environment, so a subsequent invocation of a decorated function may change it.

@bigstack
def function(...):
    """Highly recursive function."""
    ...
@bigstack(stacksize=2 ** 30)    # stack size = 1GB
def function(...):
    """Highly recursive function."""
    ...

Installation

The package has been uploaded to PyPI, so you can install it with pip:

pip install bigstack

Project details


Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
bigstack-0.1.1.tar.gz (2.0 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page