Madison May added the comment:

Any chance this issue could be reopened?  I ran across this bit of code today 
when working on coverage for argparse.  I'd like to again propose the removal 
or modification of _get_args.  I understand that it's there primarily to be 
overridden, but even that's not useful.  Because _get_kwargs uses 
obj.__dict__.items(), overriding _get_args to return an iterable of positional 
args results in those arguments being output twice when repr() is called (once 
formatted as a positional arg and once formatted as a keyword arg).  You end up 
with strings like the below.  I just can't think of any situation where this 
behavior would be desirable.

Action(['--foo', '-a', '-b'], 'b', option_strings=['--foo', '-a', '-b'], 
dest='b', nargs='+', const=None, default=42, type='int', choices=[1, 2, 3], 
help='HELP', metavar='METAVAR')

----------
nosy: +madison.may

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

Reply via email to