From dfad850c33c0ec9f3c906a249ba2b701174957a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Dur=C3=A3o?= Date: Sat, 1 Mar 2025 23:07:22 -0100 Subject: [PATCH] Fix invalid choices documentation --- Doc/library/argparse.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst index 8d0116d8c060b8..d7dd39441fc6c4 100644 --- a/Doc/library/argparse.rst +++ b/Doc/library/argparse.rst @@ -599,7 +599,7 @@ are strings:: >>> parser.add_argument('integers', metavar='N', type=int, nargs='+', ... help='an integer for the accumulator') >>> parser.parse_args(['--action', 'sumn', 1, 2, 3]) - tester.py: error: argument --action: invalid choice: 'sumn', maybe you meant 'sum'? (choose from 'sum', 'max') + tester.py: error: argument --action: invalid choice: 'sumn', maybe you meant 'sum'? (choose from sum, max) If you're writing code that needs to be compatible with older Python versions and want to opportunistically use ``suggest_on_error`` when it's available, you @@ -1121,8 +1121,8 @@ if the argument was not one of the acceptable values:: Namespace(move='rock') >>> parser.parse_args(['fire']) usage: game.py [-h] {rock,paper,scissors} - game.py: error: argument move: invalid choice: 'fire' (choose from 'rock', - 'paper', 'scissors') + game.py: error: argument move: invalid choice: 'fire' (choose from rock, + paper, scissors) Note that inclusion in the *choices* sequence is checked after any type_ conversions have been performed, so the type of the objects in the *choices*