Message358591
This patch changes the super class, _AttributeHolder. ArgumentParser and Actions also inherit from this, though they have their own _get_kwargs methods, and so aren't affected by the sort and its removal.
I just had occasion on stackoverflow to discuss the order in which attributes are added. A poster wanted to preserve the sys.argv order.
https://stackoverflow.com/questions/58904423/find-the-order-of-arguments-in-argparse-python3/58905067#58905067
Most attributes are added as defaults at the start of parsing - via a loop through parser._actions. Predefining the namespace, SUPPRESS defaults, parser.set_defaults may alter this default order.
Anyways removing the sort makes sense, and the proposed change phrase "in the order attributes were added" is sufficiently general. |
|
Date |
User |
Action |
Args |
2019-12-17 22:10:31 | paul.j3 | set | recipients:
+ paul.j3, rhettinger, eric.snow |
2019-12-17 22:10:31 | paul.j3 | set | messageid: <1576620631.19.0.692742579814.issue39058@roundup.psfhosted.org> |
2019-12-17 22:10:31 | paul.j3 | link | issue39058 messages |
2019-12-17 22:10:31 | paul.j3 | create | |
|