larzstack
A LIFO stack - named so intent reads clearly.
Built on a plain list - the built-in push/pop already do the work, this package just names the pattern so intent reads clearly at the call site (stack.push vs a bare list.push leaves no doubt about the data structure in use).
larzscript pkg install stack
What you get
- The classic LIFO vocabulary - push/pop/peek
- Built on the language's own push/pop - no reinvention
- Throws a clear error on empty-stack pop/peek
- Names the pattern so intent reads clearly
Try it
import "stack" as stack let s = stack.new() stack.push(s, 1); stack.push(s, 2) print(stack.pop(s)) print(stack.peek(s)) print(stack.is_empty(s))
Output
2 1 false
Why it's in the Larz Stack
larzstack is a real Larzscript package (larzscript pkg install stack) - money-native, zero dependencies, the same language as the rest of the estate, not a separate Python runtime. It composes with the rest of the Larz Stack and the Larz framework.