Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/IPython/utils/generics.py: 70%

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

10 statements  

1# encoding: utf-8 

2"""Generic functions for extending IPython.""" 

3 

4from IPython.core.error import TryNext 

5from functools import singledispatch 

6 

7 

8@singledispatch 

9def inspect_object(obj): 

10 """Called when you do obj?""" 

11 raise TryNext 

12 

13 

14@singledispatch 

15def complete_object(obj, prev_completions): 

16 """Custom completer dispatching for python objects. 

17 

18 Parameters 

19 ---------- 

20 obj : object 

21 The object to complete. 

22 prev_completions : list 

23 List of attributes discovered so far. 

24 This should return the list of attributes in obj. If you only wish to 

25 add to the attributes already discovered normally, return 

26 own_attrs + prev_completions. 

27 """ 

28 raise TryNext