ipython / ipython

Official repository for IPython itself. Other repos in the IPython organization contain things like the website, documentation builds, etc.

Home Page:https://ipython.readthedocs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lazy Load a Variable

mlucool opened this issue · comments

Similar to lazy loading magics, we'd find it useful if we could lazy load variables. That is, users want to do something like as soon as they start IPython (no imports/code needed):

o.fn1().fn2()

Here they know what o means to them and they use it all the time and know it means:

from foo import Bar
from baz import qux

o = Bar(qux)

So ideally in IPython startup they can define variable -> imports + code to be evaluated the first time they try to access this global.

Would you expect foo, Bar, baz and qux to be in final namespace ?

Would you expect foo, Bar, baz and qux to be in final namespace ?

No