paul j3 added the comment:

This nargs test using the formater applies only when the container has a help 
formatter.  That is true for a ArgumentParser, but not for an argument_group.

group = parser.add_argument_group('g')
group.add_argument('bar', nargs='test')

does not raise an error.

format_help will produce an error: ...
      File "./argparse.py", line 585, in _format_args
        formats = ['%s' for _ in range(action.nargs)]
    TypeError: 'str' object cannot be interpreted as an integer

while parse_args produces the error: ...
      File "./argparse.py", line 2200, in _get_nargs_pattern
        nargs_pattern = '(-*%s-*)' % '-*'.join('A' * nargs)
    TypeError: can't multiply sequence by non-int of type 'str'

----------

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

Reply via email to