3 ms·
> At least JavaScript doesn't have typed catches. Holy black mother of darkness, that shit is intolerable. I would like the author to expand a bit instead. In
by gbog 15y ago
> At least JavaScript doesn't have typed catches. Holy black mother of darkness, that shit is intolerable.
I would like the author to expand a bit instead. In python there are typed catches, it seems to make a lot of sense to me: you catch only the exceptions you want, and let the other ones bubble up. It is well explained in Martelli's Python in a Nutshell.
I have seen try/catch construct in Java and Javascript, and it is probably less readable, and certainly can be over-used, but in Python, returning None in all exceptional cases is annoying, different issues got merged into a single "Muted" case.