Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Expose InteractiveShell instance to user as _ipy.

  • Loading branch information...
commit d9748b01ca7a70fa3f763416fe5b11a5d9ce962e 1 parent b460945
@takluyver authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 IPython/core/interactiveshell.py
View
5 IPython/core/interactiveshell.py
@@ -29,6 +29,8 @@
import sys
import tempfile
import types
+from weakref import proxy
+
try:
from contextlib import nested
except:
@@ -1056,7 +1058,8 @@ def init_user_ns(self):
# Store myself as the public api!!!
ns['get_ipython'] = self.get_ipython
-
+ ns['_ipy'] = proxy(self) # Weak ref since this is a circular reference
+
ns['exit'] = self.exiter
ns['quit'] = self.exiter
Please sign in to comment.
Something went wrong with that request. Please try again.