siuba icon indicating copy to clipboard operation
siuba copied to clipboard

placeholder variable retaining state in MS VSCode

Open ValdarT opened this issue 4 years ago • 6 comments

siuba does not work in Microsoft Visual Studio Code interactive window: for some reason the placeholder variable retains its state (i.e., the outcome of the previous calculation) which of course prevents using it further (without reimporting).

I have version 1.1.3 of pandas and version 0.0.24 of siuba. From VScode side, I'm using 1.51.1 with v2020.11.0 of MS Python extension and v1.1.85 of Pyright extension installed.

Not sure whether there's anything you can do on the siuba side but wanted to let you know.

This is a fantastic initiative, thank you for this!

ValdarT avatar Nov 14 '20 12:11 ValdarT

Ah, thanks for the heads up! I haven't used VS Code in a while, but am downloading now to check it out :o.

machow avatar Nov 17 '20 18:11 machow

hmm.. I wasn't able to replicate, but am not too familiar with vs code. Are you using a specific extension to run code interactively in IPython?

Here's what I tried (but note that the interactive mode is using plain python, so I may be missing a critical piece..):

vscode

machow avatar Nov 18 '20 00:11 machow

Yes, it happens when run in Python Interactive window (the feature is part of Microsoft Python extension). Running in terminal works fine for me as well.

ValdarT avatar Nov 18 '20 08:11 ValdarT

Ah, okay--thanks for the help. I tried running in a python interactive window, and it seems to work okay:

python_interactive

Any idea what I might be missing? If possible, would you mind sending a screencast (or screenshots) of the issue?

machow avatar Nov 19 '20 15:11 machow

Hmm, no idea. The Pylance extension, perhaps?

siuba_vscode_issue

ValdarT avatar Nov 19 '20 20:11 ValdarT

The underscore access to the last values is a feature of the IPython shell: https://ipython.org/ipython-doc/3/interactive/reference.html#output-caching-system

You could try setting InteractiveShell.cache_size = 0 in your IPython config file.

grst avatar May 02 '21 08:05 grst