[issue9026] argparse subcommands not printed in the same order they were added
report at bugs.python.org
Fri Jul 23 16:33:32 CEST 2010
Javier Collado <javier.collado at gmail.com> added the comment:
The hasattr expressions were added to TestHelpFormattingMetaclass because:
- A new attribute (subparsers_signature) was added in test classes that wasn't used in the past.
- The new test classes didn't make use of some of the already in place attributes (argument_signatures, argument_signatures)
- The old test classes didn't make use of the new attribute (subparsers_signature).
- TestHelpFormattingMetaclass assumed that those attributes were present in test classes (otherwise an exception was raised).
Hence, in order not to change/break a lot of test cases, I decided to add the hasattr expressions.
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list