ipython/ipython — pull request #889 by takluyver (2011-10-17 20:59:07+00:00)
Title: Add drop_by_id method to shell, to remove variables added by extensions.

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)
```