[IPython-dev] cell magics
Sat Feb 16 18:38:24 CST 2013
On 17 February 2013 00:14, Jason Grout <firstname.lastname@example.org> wrote:
> Cool. I didn't know that. But if k was a list (for some other
> parameter), and you were trying to sub it in, you'd have to convert the
> list to a string, then convert it back in the decorator. That's a
> little silly.
In theory, but I don't think we've ever had such a case. The %%R magic has
something roughly similar - you can pass in variables including arrays, like
%%R -i myvar
In that case, the magic looks in the namespaces for 'myvar', so it doesn't
have to be converted to a string and back. Arguably you could pull the
variable in more elegantly with your proposal, something like:
But we also use the name to assign the converted variable to in R, so you'd
need to provide that separately:
That is slightly more flexible, but most of the time it's going to involve
unnecessary repetition, in addition to the extra punctuation.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-dev