On 14/10/20 6:55 am, jmwar...@gmail.com wrote:
Why waste the lines defining them anywhere other than where they are thrown and where they are handled for most of them?
If you expect people to catch these exceptions, they need to be documented somewhere. A class statement does a much better job of that than a raise statement buried somewhere in the guts of your code.
When I deal with other libraries, like requests, I keep spending
> time to figure out what variables an exception has. The vast majority of the time, when I catch an exception the only thing I want from it is an error message, and str(e) does perfectly well for that. If I need more, then if the library is well-written, help() on the exception class will tell me everything I need to know. What am I supposed to do to find out about one of your proposed classless exceptions? -- 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/FHF5UANPZOQKL3ABTYJTTLE226GMPMIU/ Code of Conduct: http://python.org/psf/codeofconduct/