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 eric.snow, paul.j3, rhettinger
Date 2019-12-17.22:10:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1576620631.19.0.692742579814.issue39058@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2019-12-17 22:10:31paul.j3setrecipients: + paul.j3, rhettinger, eric.snow
2019-12-17 22:10:31paul.j3setmessageid: <1576620631.19.0.692742579814.issue39058@roundup.psfhosted.org>
2019-12-17 22:10:31paul.j3linkissue39058 messages
2019-12-17 22:10:31paul.j3create