{"categories":[{"label":"Software Development","url":"https://skillfed.io/packages/category/software-development/5"}],"enrichment":{"capability":"Enables recursive functions to bypass Python's recursion depth limit by converting them into yield-based generators that the trampoline function executes iteratively.","skillfed_tags":["recursion-optimization","generator-pattern"],"use_cases":["Computing factorials or other recursive mathematical functions with large inputs that would normally hit the recursion limit.","Traversing deeply nested tree or graph structures without stack overflow.","Implementing tail-recursive algorithms that benefit from constant-memory execution via TailCall.","Writing recursive methods in classes where subclasses need to extend or override trampolined behavior.","Processing recursive data structures like nested lists or custom node hierarchies in a single call."],"what_it_does":"Trampoline is a minimal yield-based implementation that allows recursive functions to sidestep Python's recursion depth limit by converting them into generators. Instead of calling functions recursively, trampolined functions yield the generator of the next call they want to make; the trampoline function then executes these generators iteratively, effectively simulating unlimited recursion without consuming stack frames.\n\nTo use it, you convert a recursive function into a generator by adding yield statements before recursive calls, then wrap the initial call with trampoline(). The package handles return values through yield expressions, preserves exception tracebacks, and supports tail calls via a TailCall exception. It has no external dependencies and consists of roughly 30 lines of core logic, making it lightweight and easy to understand.","worth_installing":"No. The package is abandoned (last release 2018-08-18) and only declares support for Python 3.5, 3.6, 3.7, making it a poor fit for modern Python environments. While the concept is sound and the code is simple, the lack of maintenance means no compatibility fixes for newer Python versions, no bug fixes, and no assurance it will work with current tooling. For new projects, consider implementing a similar pattern yourself; for legacy code already using it, proceed with caution and test thoroughly on your target Python version."},"id":"trampoline","links":{"html":"https://skillfed.io/packages/trampoline","md":"https://skillfed.io/packages/trampoline.md","pypi":"https://pypi.org/project/trampoline/"},"maintenance":{"status":"abandoned"},"meta":{"latest_release":"2018-08-18","license_spdx":null,"license_treatment":"permissive","name":"trampoline","python_support":"unspecified","summary":"Simple and tiny yield-based trampoline implementation."},"popularity":{"monthly_downloads":1796619,"position":3550,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"0.1.2"}
