3 Matching Annotations
- Feb 2021
Not all cases can be covered and easily restored. And sometimes when we will reuse this function for different use-cases we will find out that it requires different restore logic.
But why do we return 0? Why not 1? Why not None? And while None in most cases is as bad (or even worse) than the exceptions, turns out we should heavily rely on business logic and use-cases of this function.
So, the sad conclusion is: all problems must be resolved individually depending on a specific usage context. There’s no silver bullet to resolve all ZeroDivisionErrors once and for all. And again, I am not even covering complex IO flows with retry policies and expotential timeouts.
- actually consider / think about how it _should_ (ideally) be
- error/exception handling
- sad/unfortunate conclusion
- the specific context is important
- need to solve specific case/problems individually (there is no general solution)
- depends on use case / application