From 93ab21aad5039f5af7929ecaeaa88d8559d26537 2021-12-20 17:22:08 From: Matthias Bussonnier Date: 2021-12-20 17:22:08 Subject: [PATCH] undeprecate info Deprecation/removal was overzealous. Closes #13407 --- diff --git a/IPython/core/oinspect.py b/IPython/core/oinspect.py index db2bd57..15f8b90 100644 --- a/IPython/core/oinspect.py +++ b/IPython/core/oinspect.py @@ -588,7 +588,7 @@ class Inspector(Colorable): Titles or keys to omit from output (can be set, tuple, etc., anything supporting `in`) """ - info = self._info(obj, oname=oname, info=info, detail_level=detail_level) + info = self.info(obj, oname=oname, info=info, detail_level=detail_level) _mime = { 'text/plain': [], @@ -702,15 +702,22 @@ class Inspector(Colorable): del info['text/html'] page.page(info) - def info(self, obj, oname="", formatter=None, info=None, detail_level=0): - """DEPRECATED since 5.0. Compute a dict with detailed information about an object.""" - if formatter is not None: - warnings.warn('The `formatter` keyword argument to `Inspector.info`' - 'is deprecated as of IPython 5.0 and will have no effects.', - DeprecationWarning, stacklevel=2) - return self._info(obj, oname=oname, info=info, detail_level=detail_level) + def _info(self, obj, oname="", info=None, detail_level=0): + """ + Inspector.info() was likely unproperly marked as deprecated + while only a parameter was deprecated. We "un-deprecate" it. + """ + + warnings.warn( + "The `Inspector.info()` has been un-deprecated as of 8.0 and the" + " `formatter=` keyword removed. `Inspector._info` is now an alias." + " You can always call `.info()` directly.", + DeprecationWarning, + stacklevel=2, + ) + return self.info(obj, oname=oname, info=info, detail_level=detail_level) - def _info(self, obj, oname='', info=None, detail_level=0) -> dict: + def info(self, obj, oname="", info=None, detail_level=0) -> dict: """Compute a dict with detailed information about an object. Parameters