diff --git a/docs/source/interactive/qtconsole.rst b/docs/source/interactive/qtconsole.rst index d6397ae..0394569 100644 --- a/docs/source/interactive/qtconsole.rst +++ b/docs/source/interactive/qtconsole.rst @@ -57,6 +57,17 @@ for playing with examples from documentation, such as matplotlib. ...: ...: plt.show() +The ``%load`` magic can also load source code from objects in the user or +global namespace by invoking the ``-n`` option. + +.. sourcecode:: ipython + + In [1]: import hello_world + ...: %load -n hello_world.say_hello + + In [3]: def say_hello() : + ...: print("Hello World!") + Inline Matplotlib ================= diff --git a/docs/source/whatsnew/pr/load_from_namespace.rst b/docs/source/whatsnew/pr/load_from_namespace.rst new file mode 100644 index 0000000..25d33b7 --- /dev/null +++ b/docs/source/whatsnew/pr/load_from_namespace.rst @@ -0,0 +1,6 @@ +Adds object inspection to %load magic so that source for objects in user or global namespaces can be loaded. To enable searching the namespace, use the ``-n`` option. + +.. sourcecode:: ipython + + In [1]: %load -n my_module.some_function +