Skip to content

Commit 9979e69

Browse files
committed
Update for failing doc_test.
1 parent 101e368 commit 9979e69

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Doc/library/argparse.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,6 +1146,9 @@ By default, when a user passes both a ``type`` and a ``choices`` argument, the
11461146
This can cause confusing ``usage`` and ``help`` strings.
11471147
To specify ``choices`` before conversion, set the flag ``convert_choices``.
11481148

1149+
>>> def to_dow(s):
1150+
... return ['mo', 'tu', 'we', 'th', 'fr', 'sa', 'su'].index(x)
1151+
...
11491152
>>> parser = argparse.ArgumentParser()
11501153
>>> parser.add_argument('when',
11511154
... choices=['mo', 'tu', 'we', 'th', 'fr', 'sa', 'su'],

0 commit comments

Comments
 (0)