Skip to content

Commit 1867c71

Browse files
fixing some minor error part 2
1 parent 3e87e19 commit 1867c71

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Doc/library/argparse.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1835,7 +1835,7 @@ Sub-commands
18351835
.. versionadded:: 3.13
18361836

18371837
One particularly effective way of handling subcommands is to combine the use
1838-
of the :meth:`add_subparsers` method with calls to :meth:`set_defaults` so
1838+
of the :meth:`~ArgumentParser.add_subparsers` method with calls to :meth:`~ArgumentParser.set_defaults` so
18391839
that each subparser knows which Python function it should execute. For
18401840
example::
18411841

@@ -1871,12 +1871,12 @@ Sub-commands
18711871
>>> args.func(args)
18721872
((XYZYX))
18731873

1874-
This way, you can let :meth:`parse_args` do the job of calling the
1874+
This way, you can let :meth:`~ArgumentParser.parse_args` do the job of calling the
18751875
appropriate function after argument parsing is complete. Associating
18761876
functions with actions like this is typically the easiest way to handle the
18771877
different actions for each of your subparsers. However, if it is necessary
18781878
to check the name of the subparser that was invoked, the ``dest`` keyword
1879-
argument to the :meth:`add_subparsers` call will work::
1879+
argument to the :meth:`~ArgumentParser.add_subparsers` call will work::
18801880

18811881
>>> parser = argparse.ArgumentParser()
18821882
>>> subparsers = parser.add_subparsers(dest='subparser_name')

0 commit comments

Comments
 (0)