Skip to content

Cell internal variables not exposed to debugger #10269

Description

@yairchu

Describe the bug

When debugging and trying to print variables in scope, the cell-internal variables (those starting with underscore) are not visible even when the debugger is viewing the scope or expression directly using them.

If we have a cell such as:

a = 7
_b = 3 + a
_b + "Hello"

Debugging the exception in that cell, we can do p a but we can't do p _b (that results in NameError: name '_b' is not defined).

Will you submit a PR?

  • Yes

Environment

{
"marimo": "0.23.14",
"editable": false,
"location": "/Users/yairchu/dev/undersampled_add_sub/.venv/lib/python3.13/site-packages/marimo",
"OS": "Darwin",
"OS Version": "25.5.0",
"Processor": "arm",
"Python Version": "3.13.2",
"Locale": "C/en_US",
"Binaries": {
"Browser": "140.0.7339.134",
"Node": "v23.11.0",
"uv": "0.11.16 (135a36367 2026-05-21 aarch64-apple-darwin)"
},
"Dependencies": {
"click": "8.4.2",
"docutils": "0.23",
"itsdangerous": "2.2.0",
"jedi": "0.19.2",
"markdown": "3.10.2",
"narwhals": "2.24.0",
"packaging": "26.2",
"psutil": "7.2.2",
"pygments": "2.20.0",
"pymdown-extensions": "10.21.3",
"pyyaml": "6.0.3",
"starlette": "1.3.1",
"tomlkit": "0.15.1",
"typing-extensions": "4.16.0",
"uvicorn": "0.51.0",
"websockets": "16.1.1"
},
"Optional Dependencies": {
"anywidget": "0.11.0",
"loro": "1.13.2",
"mcp": "1.28.1",
"openai": "2.46.0",
"pandas": "3.0.3",
"python-lsp-ruff": "2.3.1",
"python-lsp-server": "1.14.0",
"ruff": "0.15.22",
"ty": "0.0.62"
},
"Experimental Flags": {}
}

Code to reproduce

a = 7
_b = 3 + a
_b + "Hello"

--- Debug exception

> p a
7
(Pdb)
> p _b
*** NameError: name '_b' is not defined
(Pdb)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions