On Tue, Nov 5, 2019, at 16:22, Greg Ewing wrote: > Random832 wrote: > > I have, occasionally, wanted to be able to resume a function > > after handling an exception ... In a hypothetical > > implementation that would allow such a thing, having the raise return a > > value > > in such a scenario might not be unreasonable. > > For that to be of any use, the code that raises the exception > would have to be aware of the possibility that it could be > resumed, and could therefore do something other than raising, > such as calling a hook function that may or may not raise an > exception.
Like I said, my scenario was wanting to bolt async (or generator yield, I suppose) onto functions that don't support it. In the implementation I got as far as designing before realizing there was no way to resume after an exception, the exception would have been thrown (and resumed) within a callback wrapper I controlled, but being able to "do something other than raising" doesn't help it with the actual goal, which is to *stop execution of the calling function until the result of the async callback is available*. _______________________________________________ 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/MRFZG6XTYYTLWX3TPZC65BNF4O737SAC/ Code of Conduct: http://python.org/psf/codeofconduct/