MCPcopy Index your code
hub / github.com/python/cpython / fetch_tip

Method fetch_tip

Lib/idlelib/calltip.py:108–130  ·  view source on GitHub ↗

Return the argument list and docstring of a function or class. If there is a Python subprocess, get the calltip there. Otherwise, either this fetch_tip() is running in the subprocess or it was called in an IDLE running without the subprocess. The subprocess environ

(self, expression)

Source from the content-addressed store, hash-verified

106 self.active_calltip.showtip(argspec, sur_paren[0], sur_paren[1])
107
108 def fetch_tip(self, expression):
109 """Return the argument list and docstring of a function or class.
110
111 If there is a Python subprocess, get the calltip there. Otherwise,
112 either this fetch_tip() is running in the subprocess or it was
113 called in an IDLE running without the subprocess.
114
115 The subprocess environment is that of the most recently run script. If
116 two unrelated modules are being edited some calltips in the current
117 module may be inoperative if the module was not the last to run.
118
119 To find methods, fetch_tip must be fed a fully qualified name.
120
121 """
122 try:
123 rpcclt = self.editwin.flist.pyshell.interp.rpcclt
124 except AttributeError:
125 rpcclt = None
126 if rpcclt:
127 return rpcclt.remotecall("exec", "get_the_calltip",
128 (expression,), {})
129 else:
130 return get_argspec(get_entity(expression))
131
132
133def get_entity(expression):

Callers 2

open_calltipMethod · 0.95
get_the_calltipMethod · 0.45

Calls 3

get_argspecFunction · 0.85
get_entityFunction · 0.85
remotecallMethod · 0.80

Tested by

no test coverage detected