Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/IPython/core/getipython.py: 40%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

5 statements  

1"""Simple function to call to get the current InteractiveShell instance 

2""" 

3 

4#----------------------------------------------------------------------------- 

5# Copyright (C) 2013 The IPython Development Team 

6# 

7# Distributed under the terms of the BSD License. The full license is in 

8# the file COPYING, distributed as part of this software. 

9#----------------------------------------------------------------------------- 

10 

11#----------------------------------------------------------------------------- 

12# Classes and functions 

13#----------------------------------------------------------------------------- 

14 

15 

16def get_ipython(): 

17 """Get the global InteractiveShell instance. 

18 

19 Returns None if no InteractiveShell instance is registered. 

20 """ 

21 from IPython.core.interactiveshell import InteractiveShell 

22 if InteractiveShell.initialized(): 

23 return InteractiveShell.instance()