ipython/ipython — pull request #5650 by titsworth (2014-04-17 01:54:41+00:00)
Title: Expanded %load functionality - user namespace search

Added new capability to the `%load` magic to search the user's namespace for modules, classes, or functions and inspects those to load source.

Full explanation and example here:
http://nbviewer.ipython.org/gist/titsworth/10947435

I ran the test suite, but it did not look like the module I modified had any unit tests to begin with. If I have time, I will try to write a test for my stuff and the existing code, but thought I would go ahead and submit the pull request.

Another note - I implemented this as functionality that had to be "enabled" via an argument, but I think this could probably just fall into the standard flow of load. I'd appreciate some feedback on the order of search in the find_user_code function (e.g. history -> file -> namespace module/class/function -> namespace string/macro)