@@ -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)
0 commit comments