From a32b2ff470341fc2bf1f049c38e2a7bf491531a9 2024-12-10 14:51:03 From: M Bussonnier Date: 2024-12-10 14:51:03 Subject: [PATCH] Remove deprecated call_tip since 6.0 (#14607) Nothing should be using it. --- diff --git a/IPython/core/oinspect.py b/IPython/core/oinspect.py index a4fdc28..3577337 100644 --- a/IPython/core/oinspect.py +++ b/IPython/core/oinspect.py @@ -334,43 +334,6 @@ def format_argspec(argspec): return inspect.formatargspec(argspec['args'], argspec['varargs'], argspec['varkw'], argspec['defaults']) -@undoc -def call_tip(oinfo, format_call=True): - """DEPRECATED since 6.0. Extract call tip data from an oinfo dict.""" - warnings.warn( - "`call_tip` function is deprecated as of IPython 6.0" - "and will be removed in future versions.", - DeprecationWarning, - stacklevel=2, - ) - # Get call definition - argspec = oinfo.get('argspec') - if argspec is None: - call_line = None - else: - # Callable objects will have 'self' as their first argument, prune - # it out if it's there for clarity (since users do *not* pass an - # extra first argument explicitly). - try: - has_self = argspec['args'][0] == 'self' - except (KeyError, IndexError): - pass - else: - if has_self: - argspec['args'] = argspec['args'][1:] - - call_line = oinfo['name']+format_argspec(argspec) - - # Now get docstring. - # The priority is: call docstring, constructor docstring, main one. - doc = oinfo.get('call_docstring') - if doc is None: - doc = oinfo.get('init_docstring') - if doc is None: - doc = oinfo.get('docstring','') - - return call_line, doc - def _get_wrapped(obj): """Get the original object if wrapped in one or more @decorators