diff options
Diffstat (limited to 'Lib/pydoc.py')
-rwxr-xr-x | Lib/pydoc.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py index 3f2a5d85c9..e1e6d80685 100755 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -1694,9 +1694,12 @@ class Helper: 'CONTEXTMANAGERS': ('context-managers', 'with'), } - def __init__(self, input, output): - self.input = input - self.output = output + def __init__(self, input=None, output=None): + self._input = input + self._output = output + + input = property(lambda self: self._input or sys.stdin) + output = property(lambda self: self._output or sys.stdout) def __repr__(self): if inspect.stack()[1][3] == '?': @@ -1872,7 +1875,7 @@ Enter any module name to get more help. Or, type "modules spam" to search for modules whose descriptions contain the word "spam". ''') -help = Helper(sys.stdin, sys.stdout) +help = Helper() class Scanner: """A generic tree iterator.""" |