Hard reset #334

Merged
merged 4 commits into from Apr 7, 2011

Conversation

Projects
None yet
2 participants
Owner

takluyver commented Apr 7, 2011

As requested in issue #49, this is a "hard reset", which should release any references we have to things, and completely reset the shell.

I've implemented this with a -h option to %reset. I've left %reset just clearing the user namespace by default. If this was being written from scratch, I think I would make %reset do a hard reset by default, but a soft reset is consistent with what it was already doing.

Owner

fperez commented Apr 7, 2011

We're changing enough things in 0.11 that changing defaults to more sensible/useful behavior is within bounds (e.g. we did that already for %history, where now numbers are NOT the default anymore). So feel free to change it to the more sensible default, perhaps just adding a '-soft' option or '-user' for user namespace-only cleanup.

Owner

takluyver commented Apr 7, 2011

OK, done!

Owner

fperez commented Apr 7, 2011

BTW, is this clearing _NN, _iNN and _oNN variables?

Owner

takluyver commented Apr 7, 2011

Yes. InteractiveShell.reset() completely nukes the user namespace (except
for builtin and builtins, which you special cased).

@takluyver takluyver merged commit 3818b41 into ipython:master Apr 7, 2011

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