{"by":"tillahoffmann","descendants":31,"id":43390823,"kids":[43390986,43392534,43395651,43392985,43390908,43391720,43391772,43409740,43393172,43391512,43391091,43392479],"score":67,"text":"localscope is a small Python package that disassembles functions to check if they access global variables they shouldn&#x27;t. I wrote this a few years ago to detect scope bugs which are common in Jupyter notebooks. It&#x27;s recently come in handy writing jax code (<a href=\"https:&#x2F;&#x2F;github.com&#x2F;jax-ml&#x2F;jax\" rel=\"nofollow\">https:&#x2F;&#x2F;github.com&#x2F;jax-ml&#x2F;jax</a>) because it requires pure functions. Thought I&#x27;d share.","time":1742232794,"title":"Show HN: Localscope–Limit scope of Python functions for reproducible execution","type":"story","url":"https://localscope.readthedocs.io/en/latest/"}