paul j3 <ajipa...@gmail.com> added the comment:
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. ---------- nosy: +paul.j3 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue39058> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com