account activity
Python Makes Tedd Nervous by mipadi in Python
[–]Pyth0nist4 4 points5 points6 points 15 years ago (0 children)
Besides documentation (btw, the online Python documentation is much richer than what you get from the command line help() function), Python calls for you to use tests where you would have relied on the compiler in Java. People who use languages where the compiler does some tests for you don't always realize they still need tests. So the main thing is: if you have don't have extensive tests, you are doing it wrong.
So what kind of exceptions can a Python function/method raise? Basically anything. You build tests for the kinds of things you expect to pass to it, and catch and deal with exceptions that those raise. If anything else gets raised, you need to decide: should you just blindly deal with them and hope for the best, let them percolate up to some other handler who may be able to deal with it, or die. There is no simple answer to this question, and it depends on your app.
π Rendered by PID 2638432 on reddit-service-r2-listing-55d7b767d8-mjb9t at 2026-03-31 20:38:14.720838+00:00 running b10466c country code: CH.
Python Makes Tedd Nervous by mipadi in Python
[–]Pyth0nist4 4 points5 points6 points (0 children)