Localscope–Limit scope of Python functions for reproducible execution
localscope is a small Python package that disassembles functions to check if they access global variables they shouldn't. I wrote this a few years ago to detect scope bugs which are common in Jupyter notebooks. It's recently come in handy writing jax code (https://github.com/jax-ml/jax) because it requires pure functions. Thought I'd share.
Localscope–Limit scope of Python functions for reproducible execution launched on March 17, 2025 with 67 votes, #479 of 7,215 launches that month and more than 95% of that year's launches. The site was still online in September 2026, 1 year on.
In plain words
Localscope is a Python package that analyzes functions by disassembling their code to detect unwanted access to global variables. Originally created to catch scope bugs common in Jupyter notebooks, it proves particularly useful for writing JAX code, which requires pure functions with no external dependencies. The tool helps developers identify and fix scope-related issues that can compromise reproducibility and correctness.
written from the facts on this page · September 2026
From the sources
Have you ever hunted bugs caused by accidentally using a global variable in a function in a Jupyter notebook ? Have you ever scratched your head because your code broke after restarting the Python kernel? localscope can help by restricting the variables a function can access. >>> from localscope import localscope >>> >>> a = 'hello world' >>> >>> @localscope ... def print_a (): ... print ( a ) Traceback (most recent call last): ... localscope.LocalscopeException : `a` is not a permitted global (file "...", line 1, in print_a) See the Interface section for an exhaustive list of options and the Motivation and Example for a more detailed example. $ pip install localscope Interface ¶…from localscope.readthedocs.io
Does a similar job
all alternatives →
Python decorator to log local variables with each line of code run2023 · pypi.org · ▲42Print each local variable and line of code at execution
CLJS Fiddle – ClojureScript2016 · cljsfiddle.com · ▲82A private, browser-only ClojureScript playground powered by the self-hosted compiler.
Leporello.js – interactive functional programming IDE for JavaScript2023 · leporello.tech · ▲107Hi! Leporello.js is an interactive functional programming environment designed for pure functional subset of JavaScript. It executes code instantly as you type and displays results next to it. Leporello.js also features an omnipresent debugger. Just position your cursor on any line or select any expression, and immediately see its value. Leporello.js visualizes a dynamic call tree of your program. Thanks to the data immutability in functional programming, it allows you to navigate the call tree both forward and backward, offering a time-travel-like experience. Leporello.js offers the ability…
A local Python prototyping tool for Jupyter and Streamlit2023 · github.com · ▲65Hey HN! I built a local Python prototyping tool that is finally the Python development environment I've always wanted. It has a Jupyter notebook for data crunching, a database of your choice (Python or MongoDB), and a Streamlit app for building a frontend visualization. You can edit the Streamlit backend via an embedded VSCode editor, or locally on your own IDE. The best part for me is that the database connectors within Jupyter and Streamlit are configured out-of-the-box, so you don't need to spend time thinking about how to tie all that together - you can just pick the database you want to…
Browser-based XSS scanner2024 · github.com · ▲57This is a simple single-file python program that can find basic XSS (cross-site scripting) vulnerabilities in a target url. Most XSS discovery tools use a payload refelection strategy in which payloads are injected in url parameters and the GET response is inspected for places where the payload content is reflected. This is a very low precision XSS detection strategy because most reflection does not support execution. This program uses a different approach, and instead opens the target url in a browser, tests alert(...) payloads directly in the browser context, and listens for an alert being…
Jax-JS, array library in JavaScript targeting WebGPUJan 2026 · ss.ekzhang.com · ▲84JAX in pure JavaScript, as a flexible machine learning library and compiler.
More dev tools this month
the category →

open-source IDE for thoughtful software design. Contribute to devdotfast/whiteboard development by creating an account on GitHub.
Dev tools · 28d ago · github.com

Contribute to reladraw/reladraw development by creating an account on GitHub.
Dev tools · 26d ago · github.com
OpenBot▲362Grok Bot alternative: free, local, open-source, multiplayer
Dev tools · 24d ago · openbot.run

Contribute to oosexgang/hackios-xnu-kernel development by creating an account on GitHub.
Dev tools · 13h ago · github.com
Talanoa▲346Hi HN, I’m a fullstack developer, and honestly, I’ve lost count of how many side projects I’ve worked on over the years. But one idea kept coming back to me: a different kind of email client. It first came to me in 2014: “What if we could handle emails more like conversations?” Every year, I’d revisit this concept in my “Build Notes.” Ten years later, no one had built exactly what I had in mind — so I finally decided to do it myself. That’s how Talanoa was born. I wanted something focused on people, not timelines. I was tired of marking messages as unread just to remember to reply later, or…
Dev tools · 21d ago · talanoa.email
Source: Show HN post ↗
Launched alongside, March 2025
the whole month →
Mimic Human Research & Save Findings in AI Knowledge Base
AI · 2025 · sider.ai




