Author serhiy.storchaka
Recipients lordmauve, pitrou, rbu, serhiy.storchaka
Date 2018-07-17.13:10:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
It can be written as

    except FileNotFoundError:

If you want to save few lines of code, you can use contextlib.suppress().

    with suppress(FileNotFoundError): path.inlink()

I suggest to close this issue. It is better to keep the API simple and orthogonal. Adding an option in Path.unlink() will require adding this support of this option in third-part implementations of Path. In general, adding a single boolean parameter is not considered a good practice in Python.

A "strict" parameter in Path.resolve() does the different thing. In both cases Path.resolve() returns a value, and you can't implement strict=False by catching exception externally.
Date User Action Args
2018-07-17 13:10:28serhiy.storchakasetrecipients: + serhiy.storchaka, pitrou, lordmauve, rbu
2018-07-17 13:10:28serhiy.storchakasetmessageid: <>
2018-07-17 13:10:28serhiy.storchakalinkissue33123 messages
2018-07-17 13:10:27serhiy.storchakacreate