Provide detailed information about an object. '%pinfo object' is just a synonym for object? or ?object.
(self, parameter_s='', namespaces=None)
| 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): |