
Does anyone have any further thoughts on these? Should I split these into separate threads? On Sun, Nov 22, 2020 at 10:05 PM Todd <toddrjen@gmail.com> wrote:
On Sun, Nov 22, 2020 at 9:49 PM Matt Wozniski <godlygeek@gmail.com> wrote:
I suggest adding an "exist_ok" argument to all of these, with the default being "True" for backwards-compatibility. This argument name is already in use elsewhere in pathlib. If this is False and the file is not present, a "FileNotFoundError" is raised.
For Path.mkdir, exist_ok=True inhibits an error if a directory already exists. You're proposing that for Path.is_dir, exist_ok=True should inhibit an error if the directory does not exist.
A parameter to enable that behavior sounds reasonable to me, but it definitely shouldn't have the name "exist_ok"; it does the opposite of what exist_ok does.
Good point, perhaps "missing_ok" then.