Merge pull request #1826 from peeley/fix-repl-help
Fix help message in REPL
This commit is contained in:
commit
03404e45bd
1
AUTHORS
1
AUTHORS
@ -93,3 +93,4 @@
|
|||||||
* Andrew R. M. <nixy@nixy.moe>
|
* Andrew R. M. <nixy@nixy.moe>
|
||||||
* Tristan de Cacqueray <tdecacqu@redhat.com>
|
* Tristan de Cacqueray <tdecacqu@redhat.com>
|
||||||
* Sören Tempel <soeren@soeren-tempel.net>
|
* Sören Tempel <soeren@soeren-tempel.net>
|
||||||
|
* Noah Snelson <noah.snelson@protonmail.com>
|
||||||
|
@ -59,9 +59,19 @@ class HyQuitter(object):
|
|||||||
pass
|
pass
|
||||||
raise SystemExit(code)
|
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.quit = HyQuitter('quit')
|
||||||
builtins.exit = HyQuitter('exit')
|
builtins.exit = HyQuitter('exit')
|
||||||
|
builtins.help = HyHelper()
|
||||||
|
|
||||||
@contextmanager
|
@contextmanager
|
||||||
def extend_linecache(add_cmdline_cache):
|
def extend_linecache(add_cmdline_cache):
|
||||||
|
Loading…
Reference in New Issue
Block a user