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 jcollado
Recipients jcollado
Date 2010-06-18.10:24:37
SpamBayes Score 0.000999123
Marked as misclassified No
Message-id <1276856679.08.0.64136890627.issue9026@psf.upfronthosting.co.za>
In-reply-to
Content
What steps will reproduce the problem?
1. Run 'python subcommands.py -h' (attached file)
2. Check the ordering of the subcommands in the output:
----
subcommands:
  {a,c,b,e,d}
    a          a subcommand help
    b          b subcommand help
    c          c subcommand help
    d          d subcommand help
    e          e subcommand help
----

The ordering between brackets is different than the ordering in the one-line help for each command below. This could be a little confusing to the user.


What is the expected output? What do you see instead?
The expected output would be to use the same ordering in both places. In particular the same ordering that was used in the code when using the _SubParsersAction.add_parser method:
----
subcommands:
  {a,b,c,d,e}
    a          a subcommand help
    b          b subcommand help
    c          c subcommand help
    d          d subcommand help
    e          e subcommand help
----


What version of the product are you using? On what operating system?
OS: Ubuntu
Version: source code (rev. 87)
Python: 2.6.5

Please provide any additional information below.
Please have a look at the attached diff. It contains a patch that worked for me to preserve the ordering used in the code.

To make that possible it uses action._choices_actions (a list) instead of action.choices (a dictionary).
History
Date User Action Args
2010-06-18 10:24:39jcolladosetrecipients: + jcollado
2010-06-18 10:24:39jcolladosetmessageid: <1276856679.08.0.64136890627.issue9026@psf.upfronthosting.co.za>
2010-06-18 10:24:37jcolladolinkissue9026 messages
2010-06-18 10:24:37jcolladocreate