[issue42191] lib.argparse._check_value() using repr instead of str

2020-10-29 Thread paul j3
paul j3 added the comment: Do you realize that `choices` can be a dictionary? And since you want the user to supply a key, not a value, you might not want to use a type that does the conversion. To illustrate consider two ways of using a simple dictionary. import argparse adict = {'a': [1

[issue42191] lib.argparse._check_value() using repr instead of str

2020-10-29 Thread paul j3
paul j3 added the comment: In the Help formatting, choice_strs = [str(choice) for choice in action.choices] The use of `repr` in this check_value() error message was, I think, deliberate. For simple choices like strings and numbers it doesn't matter. But for other cases, it may help

[issue42191] lib.argparse._check_value() using repr instead of str

2020-10-29 Thread Aschwin
Change by Aschwin : -- title: lib.argparse._check_value() using repre instead of str -> lib.argparse._check_value() using repr instead of str ___ Python tracker ___ __