We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 485415e commit af01958Copy full SHA for af01958
Doc/library/contextlib.rst
@@ -356,6 +356,12 @@ Functions and classes provided:
356
with redirect_stdout(sys.stderr):
357
help(pow)
358
359
+ To discard or suppress the output of :func:`help` without collecting the data::
360
+
361
+ with open(os.devnull, 'w') as devnull:
362
+ with redirect_stdout(devnull):
363
+ help(pow)
364
365
Note that the global side effect on :data:`sys.stdout` means that this
366
context manager is not suitable for use in library code and most threaded
367
applications. It also has no effect on the output of subprocesses.
0 commit comments