[IPython-dev] dictionaries and %run oddity
Wed Nov 30 07:56:15 CST 2011
Thanks for your reply. What you observed about list, integer are what I see
and I must retract my unusuality. I must have transposed something in my
memory from the night before.
There is something that is not making sense to me from your explanation.
Here is my paraphrase of what I think you are saying. When I %run a
command, it is given its own namespace, say N1. Any variables defined in
that namespace are copied to the original namespace of my iPython session,
say N0. The function definition is not copied, however. When I then invoke
(not %run) the function from N0, it runs in N1. Then any variables created
in N1 are NOT copies to N0. So, if I would %run the function definition and
invocation in one command, then any variables defined are copied back.
What does not make sense to me is if I declare a variable global in a
function declared in a certain namespace, shouldn't that mean it is
available in the global namespace?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-dev