paul j3 <ajipa...@gmail.com> added the comment:

'-1' and '-1.23' are recognized as numbers, and treated as arguments.  '-1' 
requires some special handling because it is allowed as a flag, as in

    parser.add_argument('-1','--one')

'-1:00' on the other hand is no different from a string like '-foo'.  Default 
is to parse it as a flag.  If you don't get this error

    argument -f: expected one argument

you are likely to get:

    error: unrecognized arguments: -1:23

This can probably be closed as a duplicate of:

https://bugs.python.org/issue9334
argparse does not accept options taking arguments beginning with dash 
(regression from optparse)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue47002>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to