diff options
author | Savannah Ostrowski <savannahostrowski@gmail.com> | 2024-09-23 09:08:03 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-23 09:08:03 (GMT) |
commit | 5f5c0b9c23238dc0a1fdb764f625ae0cc5604519 (patch) | |
tree | 0de83196e58ed0938690c54bd30fc1a1e86008e9 /Doc | |
parent | 0e89f7abd494bd6c658083c1c1d50a640a1f2309 (diff) | |
download | cpython-5f5c0b9c23238dc0a1fdb764f625ae0cc5604519.zip cpython-5f5c0b9c23238dc0a1fdb764f625ae0cc5604519.tar.gz cpython-5f5c0b9c23238dc0a1fdb764f625ae0cc5604519.tar.bz2 |
GH-79714: Add mention of stderr for clarity to ArgumentParser.exit() (GH-123932)
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/argparse.rst | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst index aa1341c..c4e2dbc 100644 --- a/Doc/library/argparse.rst +++ b/Doc/library/argparse.rst @@ -1455,7 +1455,7 @@ The ``deprecated`` keyword argument of specifies if the argument is deprecated and will be removed in the future. For arguments, if ``deprecated`` is ``True``, then a warning will be -printed to standard error when the argument is used:: +printed to :data:`sys.stderr` when the argument is used:: >>> import argparse >>> parser = argparse.ArgumentParser(prog='snake.py') @@ -2235,8 +2235,8 @@ Exiting methods .. method:: ArgumentParser.exit(status=0, message=None) This method terminates the program, exiting with the specified *status* - and, if given, it prints a *message* before that. The user can override - this method to handle these steps differently:: + and, if given, it prints a *message* to :data:`sys.stderr` before that. + The user can override this method to handle these steps differently:: class ErrorCatchingArgumentParser(argparse.ArgumentParser): def exit(self, status=0, message=None): @@ -2246,8 +2246,8 @@ Exiting methods .. method:: ArgumentParser.error(message) - This method prints a usage message including the *message* to the - standard error and terminates the program with a status code of 2. + This method prints a usage message, including the *message*, to + :data:`sys.stderr` and terminates the program with a status code of 2. Intermixed parsing |