paul j3 added the comment:

While

parser._negative_number_matcher

is used during parser.parse_args() to check whether an argument string is a 
'negative number' (and hence whether to classify it as A or O).

parser._optionals._negative_number_matcher

is used during parser.add_argument() to determine whether an option_string is a 
'negative number', and hence whether to modify the _hasNegativeNumberOptionals 
flag.  If this matcher is the general r'^-.+$', adding the default '-h' will 
set this flag.  We don't want that.

Using a different matcher for these two containers might work, but is awfully 
kludgy.

----------

_______________________________________
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