def help(self):
line = readline.get_line_buffer().rstrip()
if line == '' or line[-1] != '(':
return
m = self.METHOD_PATTERN.search(line)
if not m:
return
try:
thisobject = eval(m.group(1), self.namespace)
except Exception:
return
if not inspect.ismethod(thisobject):
return
m = self.METHOD_DEF_PATTERN.match(inspect.getsource(thisobject))
if m:
print("")
print(m.group(1))
print(inspect.getdoc(thisobject).strip())
print(sys.ps1 + readline.get_line_buffer(), end='', flush=True)
评论列表
文章目录