paul j3 added the comment:

A further complication on this.  With the arguments I defined in the previous 
post

    p.parse_args('--foo test --baz 257'.split())

gives the mutually exclusive error message.  `sys.argv` does the same.

    p.parse_args(['--foo', 'test', '--baz', '257'])

does not give an error, because here the 'test' argument string is the same as 
the default 'test'.  So the m_x_g test thinks `--foo' is the default, and does 
not count as an input.

Usually in testing an argparse setup I use the list and split arguments 
interchangeably, but this shows they are not equivalent.

----------

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

Reply via email to