Add drop_by_id method to shell, to remove variables added by extensions. #889

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
@takluyver
Member

takluyver commented Oct 17, 2011

This was prompted by the revived physics extension. Extensions can drop a lot of variables into the user namespace. Ideally, if the extension is unloaded, those variables should disappear, but only if the names haven't been rebound.

This works as a counterpart to ip.push(). The idea is that an extension can work like this:

myvars = dict(a=foo(), b=bar(), c=baz())

def load_ipython_extension(ip):
    ip.push(myvars)

def unload_ipython_extension(ip):
    ip.drop_by_id(myvars)
@fperez

This comment has been minimized.

Show comment
Hide comment
@fperez

fperez Oct 17, 2011

Member

merged with rebase to avoid recursive merge for just one commit. thx!

Member

fperez commented Oct 17, 2011

merged with rebase to avoid recursive merge for just one commit. thx!

@fperez fperez closed this Oct 17, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment