3 ms·
This is a very interesting project. It makes Python behave a bit more like Perl. By default, Perl is very forgiving with errors. Instead of stopping everything
by ceronman 11y ago
This is a very interesting project. It makes Python behave a bit more like Perl. By default, Perl is very forgiving with errors. Instead of stopping everything when a non fatal error is found, Perl will try to continue and will throw a warning instead.
This behavior is very practical when writing quick scripts to automate things or process data. And this is the reason I often prefer Perl over Python for these kind of tasks.
Of course, this has a downside: when you just continue with errors, it's often hard to find the real source of them, or even notice them at all. For bigger application this might end up in weird errors in production that are hard to debug. In this case I very much prefer the behavior of vanilla Python.
- raiph 11y agoContinuing after arbitrary computation events that are meant to be fatal seems to me to be asking for trouble. It's why folk reviled Basic for its "On Error Resume Next" command. It has nothing to do with what Perl is about. Optionally resuming after a computation event that is not meant to always be fatal in a principled manner is an excellent, well known, decades-old power programming technique available in a few sufficiently powerful languages. See, for example, Common Lisp's condition system [1] or Perl 6's similar system.[2] [1] https://en.wikipedia.org/wiki/Common_Lisp#Condition_system https://en.wikipedia.org/wiki/Common_Lisp#Condition_system [2] http://design.perl6.org/S04.html#Exceptions http://design.perl6.org/S04.html#Exceptions