Skip to content

Commit 6afe4d5

Browse files
Done the new changes
1 parent 53031db commit 6afe4d5

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

Doc/library/argparse.rst

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1688,16 +1688,9 @@ Sub-commands
16881688
The *aliases* argument allows providing alternative names for this
16891689
sub-command.
16901690

1691-
The *deprecated* argument, if ``True``, marks the sub-command as
1692-
deprecated and will issue a warning when used.
1693-
1694-
All other keyword arguments are passed directly to the
1695-
:class:`!ArgumentParser` constructor.
1696-
1697-
Examples
1698-
~~~~~~~~
1691+
.. versionadded:: 3.14
16991692

1700-
Using aliases::
1693+
For example::
17011694

17021695
>>> parser = argparse.ArgumentParser()
17031696
>>> subparsers = parser.add_subparsers()
@@ -1706,7 +1699,12 @@ Sub-commands
17061699
>>> parser.parse_args(['co', 'bar'])
17071700
Namespace(foo='bar')
17081701

1709-
Using deprecated::
1702+
The *deprecated* argument, if ``True``, marks the sub-command as
1703+
deprecated and will issue a warning when used.
1704+
1705+
.. versionadded:: 3.14
1706+
1707+
For example::
17101708

17111709
>>> parser = argparse.ArgumentParser(prog='chicken.py')
17121710
>>> subparsers = parser.add_subparsers()
@@ -1715,6 +1713,10 @@ Sub-commands
17151713
chicken.py: warning: command 'fly' is deprecated
17161714
Namespace()
17171715

1716+
1717+
All other keyword arguments are passed directly to the
1718+
:class:`!ArgumentParser` constructor.
1719+
17181720
Some example usage::
17191721

17201722
>>> # create the top-level parser
@@ -2224,7 +2226,7 @@ Registering custom types or actions
22242226

22252227
Sometimes it's desirable to use a custom string in error messages to provide
22262228
more user-friendly output. In these cases, :meth:`!register` can be used to
2227-
register custom actions or types with a parser allows you to reference the
2229+
register custom actions or types with a parser and allow you to reference the
22282230
type by their registered name instead of their callable name.
22292231

22302232
The :meth:`!register` method accepts three arguments - a *registry_name*,

0 commit comments

Comments
 (0)