Re: IPython-dev Digest, Vol 174, Issue 2

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Re: IPython-dev Digest, Vol 174, Issue 2

Andreas Yankopolus
- Does this work from just a plain ipdb shell (when not sending the new function definition from emacs)?

This is getting close, but updating the function as proposed doesn’t work. Using the example code from my previous post:

ayank@snorri:~/Documents$ ./ 
In main.
> /home/ayank/Documents/
     14     print ("In main.")
     15     Pdb().set_trace()
---> 16     name()
     18 if __name__ == "__main__":

ipdb> print_name()
ipdb> name()
ipdb> !def print_name(): print ("Bob")
ipdb> print_name()
ipdb> name()

We can see that the function is updated, but functions that call it do not get updated to use the new definition. Any idea what’s going on here?

This kind of thing is no problem in Lisp, but its macro facility means that support for changing code at runtime is baked deep into the language. Perhaps there’s something missed in the IPython REPL?



IPython-dev mailing list
[hidden email]