[issue24956] Default value for an argument that is not in the choices list gets accepted

Sworddragon report at bugs.python.org
Fri Sep 4 19:05:44 CEST 2015


Sworddragon added the comment:

I was thinking about cases where the default is variable for example a call to platform.machine() while the choices list (and the script itself) might not support all exotic architectures for its use that might be returned now or in a future version of Python from this function. In this case the call to platform.machine() could be wrapped into a function that checks if the returned value is one of the values in the choices list but that would be the same that I would normally expect to be done by the argparse module.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24956>
_______________________________________


More information about the Python-bugs-list mailing list