DEPRECATED. Extract call tip data from an oinfo dict.
(oinfo, format_call=True)
| 233 | |
| 234 | @undoc |
| 235 | def 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 | |
| 269 | def _get_wrapped(obj): |
nothing calls this directly
no test coverage detected