localscope: Banishing Global Variable Bugs in Jupyter Notebooks

2025-03-17

Ever hunted down bugs caused by accidentally using global variables in a Jupyter Notebook function? localscope solves this by restricting a function's accessible scope. This prevents accidental global variable leakage, leading to more reproducible results and less debugging frustration. For example, a function calculating mean squared error relying on a global `sigma` variable will yield unpredictable results if `sigma` changes; localscope forces `sigma` to be passed as an argument, eliminating this risk.

Development