'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
+
+ @property
+ def input(self):
+ return self._input or sys.stdin
+
+ @property
+ def output(self):
+ return self._output or sys.stdout
def __repr__(self):
if inspect.stack()[1][3] == '?':
for modules whose descriptions contain the word "spam".
''')
-help = Helper(sys.stdin, sys.stdout)
+help = Helper()
class Scanner:
"""A generic tree iterator."""
Library
-------
+- Issue #8198: In pydoc, output all help text to the correct stream
+ when sys.stdout is reassigned.
+
- Issue #7909: Do not touch paths with the special prefixes ``\\.\``
or ``\\?\`` in ntpath.normpath().