Spyder Variable Explorer: forcing automatic refresh after code edits without manual cache clearing
0 reputation · 08 Jun 2023, 18:57 UTC
I'm working in Spyder (5.x, IPython console backend) and rely heavily on the Variable Explorer to inspect DataFrames and lists while iterating on a script. My understanding is that the Variable Explorer keeps a persistent cache of object representations, so when I mutate a variable in the editor and re-run a cell, the pane keeps showing the old value until I press the Refresh button or use "Clear Cached Data".
I've checked the preferences under Tools > Preferences > Variable Explorer, but I only see options for filtering and display formatting, nothing that ties a refresh to code execution. I also can't find a per-variable or per-session setting that would mark certain objects as "always live" so they're re-evaluated after each run.
My constraints: I want to avoid the performance hit of re-evaluating every large object on each execution, so a blanket auto-refresh of all variables isn't ideal. Ideally only variables I explicitly mark, or only variables below a size threshold, would update automatically.
Is there any supported configuration, plugin hook, or console-side setting in Spyder 5.x that enables selective or threshold-based automatic refresh of the Variable Explorer? If not, is the manual Refresh / "Clear Cached Data" workflow the only intended mechanism, and is this documented as a deliberate design decision?