Repository: ipython/ipython

Issue:
Clarify deprecation of Inspector.info() method
In its docstring, the [IPython.core.oinspect.Inspector.info()](https://github.com/ipython/ipython/blob/355c5f3774cdfd8320505046973aa5032c93df35/IPython/core/oinspect.py#L705) method states that it was deprecated. When the text was [originally added](https://github.com/ipython/ipython/commit/3c1ce318117e6b2630f7c5d2379e6d269f98a124), the warning applied to the whole method, but in the [same PR](), it was [modified](https://github.com/ipython/ipython/commit/9412553b1d12e84ea7155044e775432bbee164b7) to only warn when the unused `formatter` argument was passed. However, the deprecation notice was not updated, and remained unclear as to what was deprecated, why, and what to replace it with.

Of note, the deprecation was done in one of the original PRs that added Docrepr/Sphixify to  IPython. As the current de-facto maintainer of Docrepr, which is now being revitalized and heavily used in Jupyter Notebook, I was surprised to see that the `Inspector.info()` heavily used in the Docrepr test suite, with no indicated replacement, and unlike the internal-only method it wraps, it was not documented.  This led me on a wild goose chase to figure out what was going on. It looks like only the `formatter` arg should be deprecated, and the docstring clarified to reflect that (and perhaps the much more useful `_info` docstring merged? If not, the docstring should ideally be clarified as to the scope and reason for the deprecation, and what users should replace it with. Happy to submit a PR if/when there is clear indication of what this should say. Thanks!

Created as a new issue per request of @carreau 

_Originally posted by @CAM-Gerlach in https://github.com/ipython/ipython/issues/10511#issuecomment-995437839_


Discussion:
I will try to revive the info() method with proper deprecation notice in the right place if relevant, or un-deprecate if there is no replacement.
How ok are you with undeprecating `info()` but removing the `formatter` keyword, basically renaming `_info` to `info` ?

Resolving patch:
diff --git a/IPython/core/oinspect.py b/IPython/core/oinspect.py
--- a/IPython/core/oinspect.py
+++ b/IPython/core/oinspect.py
@@ -588,7 +588,7 @@ def _get_info(
             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 @@ def pinfo(
             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 improperly marked as deprecated
+        while only a parameter was deprecated. We "un-deprecate" it.
+        """
+
+        warnings.warn(
+            "The `Inspector.info()` method has been un-deprecated as of 8.0 "
+            "and the `formatter=` keyword removed. `Inspector._info` is now "
+            "an alias, and you can just 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


Test patch: