Файли
openidea/fixtures/python-app/notebooks/variables.ipynb
T
LU XIANGRUIтаwildcatDownstairs 4ff5739854 feat(notebook): show the running kernel's variables in a Jupyter Variables tool window (#6517)
A Jupyter Variables tool window (bottom, under the stripe's overflow until first opened; also in Find Action) lists the variables of the last active notebook's kernel: name, type and a truncated repr, hiding private names, modules and IPython's own names. It refreshes after a run, a kernel restart and a switch of notebook, and never starts a kernel.

The variables are read with a silent execute_request carrying a user expression (no output, history, execution count or busy/idle status), only while the kernel is idle; a run started meanwhile waits for it, bounded to 10 seconds. A notebook tab restored at startup picks up its session once it opens.

Closes #6508

Co-authored-by: wildcatDownstairs <[email protected]>
2026-11-27 23:02:19 +08:00

1.2 KiB

Kernel variables

Run the cells, then open Jupyter Variables.

In [ ]:
import json

tasks = ["write", "review", "ship"]
done = {"write": True, "review": False}
_scratch = "hidden: starts with _"
In [ ]:
class Broken:
    def __repr__(self):
        raise RuntimeError("no repr")


broken = Broken()
long_text = "x" * 500
In [ ]:
count = len(tasks)
count