@bonifartius, at this point context managers (the with thing) are the only thing keeping me doing Python. It’s capable of expressing pretty sick shits: https://vorpus.org/blog/notes-on-structured-concurrency-or-go-statement-considered-harmful
IMHO languages should either have no exceptions at all or provide a RAII-like syntactic sugar like in Python. Anything in between is just a waste of human and computing resources.
Cc: @thor
@bonifartius and @thor, it’s very common that a
try-except-finallycan be replaced by awith, and when it isn’t, most likely theelseis needed and kinda clean. I’d prefer an expressiontrylike in Raku or Zig any day but at least Python scoping allow you toexceptonly a variable definition.