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 Sworddragon, paul.j3
Date 2015-10-04.01:29:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1443922194.65.0.796168381909.issue25307@psf.upfronthosting.co.za>
In-reply-to
Content
Formatter _format_action_invocation(self, action) is the key function.  Notice how it treats positionals and optionals separately.  Also it calls

    default = self._get_default_metavar_for_optional(action)
    args_string = self._format_args(action, default)

to get the string that is placed after each option_string.

'choices' are incorporated via the _metavar_formatter() method (through several function calls).  They do not get their own separate consideration.  Tracing this calling stack is not a trivial task.

But if you want custom behavior at this point in the help, _format_action_invocation() is the function to play with.  You could even add the space for a nonexistent short option at this point.


http://bugs.python.org/issue16468 is an example of a 'choices' thread.  Note that a formatted list of choices is also shown in the 'usage' and error messages.  It's about formatting the choices string, not about where to show it.
History
Date User Action Args
2015-10-04 01:29:54paul.j3setrecipients: + paul.j3, Sworddragon
2015-10-04 01:29:54paul.j3setmessageid: <1443922194.65.0.796168381909.issue25307@psf.upfronthosting.co.za>
2015-10-04 01:29:54paul.j3linkissue25307 messages
2015-10-04 01:29:53paul.j3create