paul j3 added the comment:

If nargs=2, type=float, an argv like '1e4 -.002' works, but '1e4 -2e-3' 
produces the same error as discussed here.  The problem is that 
_negative_number_matcher does not handle scientific notation.  The proposed 
generalize matcher, r'^-.+$', would solve this, but may be overkill.

I'm not as familiar with optparse and other argument processes, but I suspect 
argparse is different in that it processes the argument strings twice.  On one 
loop it parses them, producing an arg_strings_pattern that looks like 'OAA' (or 
'OAO' in these problem cases).  On the second loop is consumes the strings 
(optionals and positionals).  This gives it more power, but produces problems 
like this if the parsing does not match expectations.

----------
nosy: +paul.j3

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

Reply via email to