[issue37564] ArgumentParser should support bool type according to truth values

paul j3 report at bugs.python.org
Mon Aug 12 11:40:58 EDT 2019


paul j3 <ajipanca at gmail.com> added the comment:

This patch lacks proper documentation, and is too English language specific.

For users who assume 'type' means a class rather than function (callable) this change does not need documentation, since it accommodates that assumption.  But more experienced users, or ones who read the documentation with care, this change could be puzzling.  "Why does 'bool' work?"  Admittedly they are unlikely to try it.  Still, we are deviating the documented behavior.

We also need to pay attention to internationalization.  Argparse wraps most error messages and string displays in 'gettext'.  There isn't any other part of argparse that assumes that sys.argv strings have English meanings.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37564>
_______________________________________


More information about the Python-bugs-list mailing list