[issue42572] Better path handling with argparse

paul j3 report at bugs.python.org
Tue Dec 8 18:01:42 EST 2020


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

One caution - the type parameter is a callable (function) that takes one string as argument.  I proposed `pathlib.Path` because it does that, returning a Path object.  It's a class instance creator.  I believe the module has other class initiators.

bool() has confused many users.  While it returns a bool class instance, True or False, the only string that returns False is the empty one, with argparse can't supply. It does not convert strings like 'False' or 'no' to boolean False.

----------

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


More information about the Python-bugs-list mailing list