[issue9182] argparse: optional argument w/ narg='+' conflicts w/ positional argsument

2010-07-06 Thread Sergey Konoplev
New submission from Sergey Konoplev gray...@gmail.com: Hello, I am starting to use argparse package and faced the problem where an optional argument w/ nargs='+' conflicts w/ a positional argument. Here is the test case: import argparse p = argparse.ArgumentParser() p.add_argument('foo',

[issue9182] argparse: optional argument w/ narg='+' conflicts w/ positional argsument

2010-07-06 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Thanks for the bug report. Can you try separating option arguments from positional arguments with “--”? If yes, this would be a doc bug. Also, can you reproduce it with Python 2.7? -- nosy: +merwok

[issue9182] argparse: optional argument w/ narg='+' conflicts w/ positional argsument

2010-07-06 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: I get the same behavior in 2.7. Adding '--', I get: p.parse_args('-b 123 456 -- bla'.split()) Namespace(bar=[123, 456], foo='bla') Which is what I expect. Éric: From your comment, I'm not sure if you think it's a doc bug because '--' does

[issue9182] argparse: optional argument w/ narg='+' conflicts w/ positional argsument

2010-07-06 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: I was suggesting a doc bug only if the current doc didn’t advertise clearly this way of combining nargs with positional arguments. Using “--” is most certainly standard and right, Using “--” to explicitly signal positional arguments is most

[issue9182] argparse: optional argument w/ narg='+' conflicts w/ positional argsument

2010-07-06 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Duh, please ignore the first two lines, I forgot to remove them after rephrasing my comment. Sorry. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9182

[issue9182] argparse: optional argument w/ narg='+' conflicts w/ positional argsument

2010-07-06 Thread Fred L. Drake, Jr.
Fred L. Drake, Jr. fdr...@acm.org added the comment: On Tue, Jul 6, 2010 at 4:33 PM, Éric Araujo rep...@bugs.python.org wrote: Using “--” to explicitly signal positional arguments is most certainly right and standard, but people have to read about that for the first time somewhere. In a