Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Rpush magic doesn't support comma separated lists of variables #2733

Open
bfroehle opened this Issue Jan 2, 2013 · 4 comments

Comments

Projects
None yet
3 participants
Contributor

bfroehle commented Jan 2, 2013

NB: This was split out of the multi-part issue #2550 as reported by @rmcgibbo.

%Rpush doesn't let you push a bunch of local variables that are separated by commas. For example, the following code throws a KeyError.

%load_ext rmagic
x, y = 1,2
%Rpush x, y

The code only works if the third line is %Rpush x y

Contributor

bfroehle commented Jan 2, 2013

Is this a necessary change, or just an annoyance? Any potential change should also apply to the related %Rpull magic.

Contributor

bfroehle commented Jan 2, 2013

To round up the comments from other issues, the suggested implementation from #2698:

  1. Replaced inputs = line.split(' ') with inputs = re.split(r'[\s,]+', line) or inputs = line.replace(',' ' ').split() in IPython/extensions/rmagic.py.
  2. Added another test array, separated by a comma, in test_push in IPython/extensions/tests/test_rmagic.py.
Contributor

rmcgibbo commented Jan 2, 2013

I wouldn't call it a necessary change, but IMO the current behavior is a bit of a wart.

Owner

ellisonbg commented Apr 10, 2013

This work has begun in #2736 but that PR has been closed due to inactivity. If someone picks up that work, feel free to reopen/fork that PR and continue along.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment