Add HyHelper object to override builtins.help, fixes REPL prompt
This commit is contained in:
parent
8d7775c0a8
commit
7af169f089
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user