Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/enricobacis/bigstack
python decorator that increases the stack size for the function
https://github.com/enricobacis/bigstack
Last synced: 2 months ago
JSON representation
python decorator that increases the stack size for the function
- Host: GitHub
- URL: https://github.com/enricobacis/bigstack
- Owner: enricobacis
- License: mit
- Created: 2017-02-14T15:14:33.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-02-14T15:17:55.000Z (almost 8 years ago)
- Last Synced: 2024-10-14T14:16:09.685Z (3 months ago)
- Language: Python
- Size: 4.88 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
bigstack
========*python decorator that increases the stack size for the function. This is useful
for highly recursive function (albeit highly recursive function are bad).*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... code:: python
@bigstack
def function(...):
"""Highly recursive function."""
..... code:: python
@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
.. _PyPI: https://pypi.python.org/pypi/bigstack