Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/IPython/utils/generics.py: 78%
9 statements
« prev ^ index » next coverage.py v7.4.4, created at 2024-04-20 06:09 +0000
« prev ^ index » next coverage.py v7.4.4, created at 2024-04-20 06:09 +0000
1# encoding: utf-8
2"""Generic functions for extending IPython.
3"""
5from IPython.core.error import TryNext
6from functools import singledispatch
9@singledispatch
10def inspect_object(obj):
11 """Called when you do obj?"""
12 raise TryNext
15@singledispatch
16def complete_object(obj, prev_completions):
17 """Custom completer dispatching for python objects.
19 Parameters
20 ----------
21 obj : object
22 The object to complete.
23 prev_completions : list
24 List of attributes discovered so far.
25 This should return the list of attributes in obj. If you only wish to
26 add to the attributes already discovered normally, return
27 own_attrs + prev_completions.
28 """
29 raise TryNext