Sergio Fenoll writes: > In the same vein as adding type annotations to code, I think it'd > be very useful to have exception "raises" annotations, i.e. a way > to annotate what exceptions a function raises.
I think you need to explain the use cases in more detail. You mention IDEs, but they can already grovel through the source code and work out exactly what exceptions each function explicitly raises, and keep a database for builtins and the stdlib, which could easily be updated by the user by running the groveler on Python itself. 3rd party imports, ditto. This would allow far more accurate inference of possible exceptions than an optional 'raises' annotation would. Even a closed-source vendor removing the .py wouldn't stop a truly dedicated groveler, I believe. Because of the way exceptions are created, there'd be a trace in a namespace in the .pyc or even in a DLL. _______________________________________________ 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/X2TMC4PT6MM2UMHJBPANFNGBTOWSZDHX/ Code of Conduct: http://python.org/psf/codeofconduct/