On Fri, Sep 25, 2020 at 6:14 PM Sergio Fenoll <ser...@fenoll.be> wrote: > I see what you mean now, and I agree. But surely there's a fairly big > overlap between > "exceptions I expect to raise" (from the POV of the callee) and > "exceptions I can handle" > (from the POV of the caller). Wouldn't it still be useful to have the > first part (exceptions > I expect to raise) defined in the code (i.e., via some kind of > annotation) in such a way that > makes it easier for the caller to handle the exceptions they want to catch? > > Or, in your opinion, should the callee not even have a notion of > "exceptions I expect to raise"? >
There's the shallow "exceptions that I expect to raise", which is those explicitly listed within the function as raise statements; but that's not the whole story, since exceptions can be raised by anything that the function calls. So, no, I don't think the callee should have a notion of "exceptions that I or anyone I call might raise". ChrisA _______________________________________________ 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/2IUTNJBADJDHCR7J7UNDRYL32PFY7YIC/ Code of Conduct: http://python.org/psf/codeofconduct/