Closed jaraco closed 8 months ago
On second thought - maybe the Pythonic way to handle trapping an exception is to just use try/except
. I'll consider that for the aforementioned issue.
Since no one has commented on this issue, I'm going to close it for now as "won't fix", but I'm happy to revisit if there are additional cases that could benefit from this behavior. Maybe we add a Distribution.exists()
that wraps the try
/except
.
In https://github.com/python/mypy/issues/16400#issuecomment-1828013480, I discovered that there's no convenient function to determine "is a distribution present". The
distribution
function does return the distribution or raise an Exception if not present, but in some cases, it may be preferable to trap the exception and translate it into a boolean.