##// END OF EJS Templates
Don't rely on `get_ipython` in builtins in library code
Don't rely on `get_ipython` in builtins in library code

File last commit:

r10579:790f7312
r10580:9656bf9c
Show More
ipapi.py
37 lines | 1.2 KiB | text/x-python | PythonLexer
Brian Granger
Continuing a massive refactor of everything.
r2205 # encoding: utf-8
MinRK
add IPython.get_ipython...
r10579 """Simple function to call to get the current InteractiveShell instance
Fernando Perez
Remove 2.3 compatibility, minor cleanups.
r1414 """
#-----------------------------------------------------------------------------
MinRK
add IPython.get_ipython...
r10579 # Copyright (C) 2013 The IPython Development Team
Brian Granger
Continuing a massive refactor of everything.
r2205 #
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
Fernando Perez
Remove 2.3 compatibility, minor cleanups.
r1414 #-----------------------------------------------------------------------------
ville
initialization (no svn history)
r988
Brian Granger
Continuing a massive refactor of everything.
r2205 #-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
Robert Kern
ENH: Allow non-dict namespaces. This involves a change in the ipapi for setting user namespaces.
r1419
MinRK
add IPython.get_ipython...
r10579 import warnings
Brian Granger
Continuing a massive refactor of everything.
r2205 #-----------------------------------------------------------------------------
# Classes and functions
#-----------------------------------------------------------------------------
Robert Kern
ENH: Allow non-dict namespaces. This involves a change in the ipapi for setting user namespaces.
r1419
Brian Granger
ipapi.get now returns None if there are no InteractiveShells running....
r2292
MinRK
add IPython.get_ipython...
r10579 def get_ipython():
"""Get the global InteractiveShell instance.
Returns None if no InteractiveShell instance is registered.
"""
Brian Granger
Fixing two minor bugs....
r2816 from IPython.core.interactiveshell import InteractiveShell
MinRK
add IPython.get_ipython...
r10579 if InteractiveShell.initialized():
return InteractiveShell.instance()
def get():
warnings.warn("ipapi.get has been deprecated since IPython 0.11",
DeprecationWarning
)
return get_ipython()
Brian Granger
First draft of refactored Component->Configurable.
r2731