MCPcopy Create free account
hub / github.com/ipython/ipython / call_tip

Function call_tip

IPython/core/oinspect.py:235–266  ·  view source on GitHub ↗

DEPRECATED. Extract call tip data from an oinfo dict.

(oinfo, format_call=True)

Source from the content-addressed store, hash-verified

233
234@undoc
235def call_tip(oinfo, format_call=True):
236 """DEPRECATED. Extract call tip data from an oinfo dict.
237 """
238 warnings.warn('`call_tip` function is deprecated as of IPython 6.0'
239 'and will be removed in future versions.', DeprecationWarning, stacklevel=2)
240 # Get call definition
241 argspec = oinfo.get('argspec')
242 if argspec is None:
243 call_line = None
244 else:
245 # Callable objects will have 'self' as their first argument, prune
246 # it out if it's there for clarity (since users do *not* pass an
247 # extra first argument explicitly).
248 try:
249 has_self = argspec['args'][0] == 'self'
250 except (KeyError, IndexError):
251 pass
252 else:
253 if has_self:
254 argspec['args'] = argspec['args'][1:]
255
256 call_line = oinfo['name']+format_argspec(argspec)
257
258 # Now get docstring.
259 # The priority is: call docstring, constructor docstring, main one.
260 doc = oinfo.get('call_docstring')
261 if doc is None:
262 doc = oinfo.get('init_docstring')
263 if doc is None:
264 doc = oinfo.get('docstring','')
265
266 return call_line, doc
267
268
269def _get_wrapped(obj):

Callers

nothing calls this directly

Calls 2

format_argspecFunction · 0.85
warnMethod · 0.80

Tested by

no test coverage detected