This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author paul.j3
Recipients monkeyman79, paul.j3, r.david.murray, v+python
Date 2021-01-26.17:02:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <[email protected]>
In-reply-to
Content
I haven't had a chance to study your longer posts, but it seems to me that the AddFruitAction example could just as well be implemented with 

    parser.add_argument('--color', nargs='*', action='append')

with post parsing processing to create the 'fruits' dicts from the appended lists.  

The basic logic of argparse is to accept optionals in any order, and positionals in strict positional order.  'nargs' allows us to pair any number of strings with each optional's flag.

While custom Action classes can implement interactions between arguments based on values in the namespace, it is usually easier to do this after parsing.  

But back to your core change, I wonder if adding a new nargs, such as '**' would be better than than the new parameter 'greedy_star=True'.  I prefer not to add parameters that are hard to document.  At this point in the argparse development, changes should be minimally invasive.
History
Date User Action Args
2021-01-26 17:02:49paul.j3setrecipients: + paul.j3, v+python, r.david.murray, monkeyman79
2021-01-26 17:02:49paul.j3setmessageid: <[email protected]>
2021-01-26 17:02:49paul.j3linkissue42973 messages
2021-01-26 17:02:49paul.j3create