Search upwards for what (if anything) is going to catch an Exception would be a mighty useful static/dynamic analysis thing. Is there anything that can do this?
I'd hazard to guess that *most* apps will just crash and expect the process spawner (e.g. systemd, supervisord, not sysV init) to re-spawn the crashed process after the unhandled fault? https://github.com/analysis-tools-dev/static-analysis#python https://github.com/analysis-tools-dev/dynamic-analysis#python https://github.com/vinta/awesome-python#code-analysis On Fri, Sep 25, 2020 at 8:35 PM Greg Ewing <greg.ew...@canterbury.ac.nz> wrote: > On 26/09/20 4:32 am, Oscar Benjamin wrote: > > annotations could be used to document in a statically > > analysable way what the "expected" exceptions are. A type checker > > could use those to check whether a caller is handling the *expected* > > exceptions > > But that would be inappropriate. Even if an exception is > "expected" (assuming for a moment we agree on what that means), > the immediate caller is *not* obliged to handle it. Just as > with any other exception, it's perfectly fine to let it propagate > up to a level where something sensible can be done with it. > > Treating this as an error would be more annoying than helpful in > most situations, I think. > > There are a few cases where it *might* make sense, such as > StopIteration, which is pretty much part of the function's API > and letting it escape is probably a mistake. But such cases > are very rare and probably not worth adding a new language > mechanism for. > > -- > Greg > _______________________________________________ > 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/DYD26ANQUYTIAO4ABCJJGQIXN7LX77ID/ > Code of Conduct: http://python.org/psf/codeofconduct/ >
_______________________________________________ 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/H3TIFOAVG536N2QU4QTZ7F3V4UYC3LDN/ Code of Conduct: http://python.org/psf/codeofconduct/