MCPcopy Index your code
hub / github.com/ipython/ipython / pinfo

Method pinfo

IPython/core/magics/namespace.py:41–59  ·  view source on GitHub ↗

Provide detailed information about an object. '%pinfo object' is just a synonym for object? or ?object.

(self, parameter_s='', namespaces=None)

Source from the content-addressed store, hash-verified

39
40 @line_magic
41 def pinfo(self, parameter_s='', namespaces=None):
42 """Provide detailed information about an object.
43
44 '%pinfo object' is just a synonym for object? or ?object."""
45
46 # print('pinfo par: <%s>' % parameter_s) # dbg
47 # detail_level: 0 -> obj? , 1 -> obj??
48 detail_level = 0
49 # We need to detect if we got called as 'pinfo pinfo foo', which can
50 # happen if the user types 'pinfo foo?' at the cmd line.
51 pinfo,qmark1,oname,qmark2 = \
52 re.match(r'(pinfo )?(\?*)(.*?)(\??$)',parameter_s).groups()
53 if pinfo or qmark1 or qmark2:
54 detail_level = 1
55 if "*" in oname:
56 self.psearch(oname)
57 else:
58 self.shell._inspect('pinfo', oname, detail_level=detail_level,
59 namespaces=namespaces)
60
61 @line_magic
62 def pinfo2(self, parameter_s='', namespaces=None):

Callers

nothing calls this directly

Calls 3

psearchMethod · 0.95
matchMethod · 0.80
_inspectMethod · 0.80

Tested by

no test coverage detected