[issue38736] argparse: wrong type from get_default when type is set

paul j3 report at bugs.python.org
Fri Nov 8 11:28:54 EST 2019


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

Yes you can set the default to be any object, such as an evaluated string.  If it isn't a string it won't be passed through 'type'.

The purpose of the delayed evaluation that I described is to avoid unnecessary evaluations.  The worse case would be a write filetype.  You don't want to create (or over write) a default file if it never gets used.

(I intend to close this issue).

----------

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


More information about the Python-bugs-list mailing list