Add HyHelper object to override builtins.help, fixes REPL prompt

This commit is contained in:
Noah Snelson 2019-10-13 22:50:47 -07:00 committed by Kodi Arfer
parent 8d7775c0a8
commit 7af169f089

View File

@ -59,9 +59,19 @@ class HyQuitter(object):
pass
raise SystemExit(code)
class HyHelper(object):
def __repr__(self):
return ("Use (help) for interactive help, or (help object) for help "
"about object.")
def __call__(self, *args, **kwds):
import pydoc
return pydoc.help(*args, **kwds)
builtins.quit = HyQuitter('quit')
builtins.exit = HyQuitter('exit')
builtins.help = HyHelper()
@contextmanager
def extend_linecache(add_cmdline_cache):