2323import math
2424import re
2525import types
26+ import warnings
2627
2728from IPython .core import oinspect
2829from IPython .utils import dir2
@@ -475,6 +476,17 @@ def _getdef(self, obj, oname=''):
475476 except : # pylint: disable=bare-except
476477 logging .exception ('Exception raised in ColabInspector._getdef' )
477478 def info (self , obj , oname = '' , formatter = None , info = None , detail_level = 0 ):
479+ """Compute a dict with detailed information about an object."""
480+ if formatter is not None :
481+ warnings .warn (
482+ 'The `formatter` keyword argument to `Inspector.info`'
483+ 'is deprecated as of IPython 5.0 and will have no effects.' ,
484+ DeprecationWarning ,
485+ stacklevel = 2 ,
486+ )
487+ return self ._info (obj , oname = oname , info = info , detail_level = detail_level )
488+
489+ def _info (self , obj , oname = '' , info = None , detail_level = 0 ):
478490 """Compute a dict with detailed information about an object.
479491
480492 This overrides the superclass method for two main purposes:
@@ -484,7 +496,6 @@ def info(self, obj, oname='', formatter=None, info=None, detail_level=0):
484496 Args:
485497 obj: object to inspect.
486498 oname: (optional) string reference to this object
487- formatter: (optional) custom docstring formatter
488499 info: (optional) previously computed information about obj
489500 detail_level: (optional) 0 or 1; 1 means "include more detail"
490501
@@ -572,8 +583,7 @@ def info(self, obj, oname='', formatter=None, info=None, detail_level=0):
572583 if source is not None :
573584 out ['source' ] = source
574585 if 'source' not in out :
575- formatter = formatter or (lambda x : x )
576- docstring = formatter (getdoc (obj ) or '<no docstring>' )
586+ docstring = getdoc (obj ) or '<no docstring>'
577587 if docstring :
578588 out ['docstring' ] = docstring
579589
@@ -619,7 +629,7 @@ def info(self, obj, oname='', formatter=None, info=None, detail_level=0):
619629 if definition :
620630 out ['definition' ] = definition
621631
622- if not oinspect .is_simple_callable (obj ):
632+ # if not oinspect.is_simple_callable(obj):
623633 call_docstring = getdoc (obj .__call__ )
624634 if call_docstring and call_docstring != _BASE_CALL_DOC :
625635 out ['call_docstring' ] = call_docstring
0 commit comments