@@ -1564,12 +1564,12 @@ it exits and prints the error along with a usage message::
15641564 >>> # invalid option
15651565 >>> parser.parse_args(['--bar'])
15661566 usage: PROG [-h] [--foo FOO] [bar]
1567- PROG: error: no such option : --bar
1567+ PROG: error: unrecognized arguments : --bar
15681568
15691569 >>> # wrong number of arguments
15701570 >>> parser.parse_args(['spam', 'badger'])
15711571 usage: PROG [-h] [--foo FOO] [bar]
1572- PROG: error: extra arguments found : badger
1572+ PROG: error: unrecognized arguments: badger
15731573
15741574
15751575Arguments containing ``- ``
@@ -1606,7 +1606,7 @@ there are no options in the parser that look like negative numbers::
16061606 >>> # negative number options present, so -2 is an option
16071607 >>> parser.parse_args(['-2'])
16081608 usage: PROG [-h] [-1 ONE] [foo]
1609- PROG: error: no such option : -2
1609+ PROG: error: unrecognized arguments : -2
16101610
16111611 >>> # negative number options present, so both -1s are options
16121612 >>> parser.parse_args(['-1', '-1'])
@@ -1624,6 +1624,11 @@ argument::
16241624See also :ref: `the argparse howto on ambiguous arguments <specifying-ambiguous-arguments >`
16251625for more details.
16261626
1627+ .. versionchanged :: 3.14
1628+ Negative-number matching was expanded to include numbers in scientific
1629+ notation (``-2.5e-6 ``), numbers containing underscores (``-1_234.5 ``),
1630+ and complex numbers (``-1.2e-3j ``).
1631+
16271632.. _prefix-matching :
16281633
16291634Argument abbreviations (prefix matching)
@@ -1679,6 +1684,12 @@ The Namespace object
16791684 Simple class used by default by :meth: `~ArgumentParser.parse_args ` to create
16801685 an object holding attributes and return it.
16811686
1687+ :class: `!Namespace ` objects support :func: `copy.replace `,
1688+ which returns a copy of the object with the specified attributes replaced.
1689+
1690+ .. versionchanged :: next
1691+ Added support for :func: `copy.replace `.
1692+
16821693 This class is deliberately simple, just an :class: `object ` subclass with a
16831694 readable string representation. If you prefer to have dict-like view of the
16841695 attributes, you can use the standard Python idiom, :func: `vars `::
0 commit comments