R. David Murray added the comment:

>>> p.add_argument('-a', action="append", default=None)
>>> p.parse_args([])
Namespace(a=None)
>>> p.parse_args(['-a', '1', '-a', '2'])
Namespace(a=['1', '2'])

So there's a logical correspondence there (repeated option vs multiple values, 
each producing a list).

I'm not sure what you mean by the difference between options and positionals.  
I note that you can use nargs with an optional, and in that case the default 
works, which is even more unfortunate than the difference with 'append'.  But 
if you can articulate a logical difference between optionals and positional 
here, maybe we can make it look reasonable :)

----------

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

Reply via email to