[issue42501] Improve error messages for argparse choices using enum

2020-11-29 Thread shangxiao
shangxiao added the comment: Oh apologies, I had "open" selected when I searched for prior issues. Upon reading that issue I agree with Mr Hettinger's points about enum values not being a concern of the parser. The solution for my needs was simple enough: I made my own action wh

[issue42501] Improve error messages for argparse choices using enum

2020-11-29 Thread shangxiao
New submission from shangxiao : Summary --- The argparse module mentions that it will happily accept an enum for the choices argument option [1]. There are currently 2 issues with this: 1. The usage displays non user-friendly values for the enum; 2. The error message for invalid values

[issue42194] Docs for argparse.BooleanOptionalAction missing "New in version 3.9"

2020-10-29 Thread shangxiao
shangxiao added the comment: Here's the section in the docs for BooleanOptionalAction: https://docs.python.org/3.9/library/argparse.html#action -- title: BooleanOptionalAction missing "New in version 3.9" -> Docs for argparse.BooleanOptionalAction missing "

[issue42194] BooleanOptionalAction missing "New in version 3.9"

2020-10-29 Thread shangxiao
New submission from shangxiao : The section that describes BooleanOptionalAction just requires a "New in version 3.9" tag -- assignee: docs@python components: Documentation messages: 379867 nosy: docs@python, shangxiao priority: normal severity: normal status: