On Sun, Nov 22, 2020 at 9:49 PM Matt Wozniski <godlyg...@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.
_______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/JFFXZEQ2NLS5LUXLI5FTXOLZJL5SZLTS/ Code of Conduct: http://python.org/psf/codeofconduct/