Earlier quoted context omitted.
> It would be nice if you could provide an example For me personally the main source of unhappiness is error messages. In C I can say if (!(f = open(name, "r"))) die(name); where die is a tiny function that prints name , followed by whatever strerror has to say to the subject, formatted in the usual fashion. One line, done with it. The obvious, conventional Python equivalent is four lines long because both try: and e…
> Since I cannot tell Python to produce succinct unixy error messages instead of rambling stack traces `sys.excepthook` is how you can do that. Without: x = {} def f(): print(x['foo']) f() # ... Traceback (most recent call last): File "stack.py", line 6, in f() File "stack.py", line 4, in f print(x['foo']) KeyError: 'foo' With: import sys def short_err(exc_type, exc, tb): sys.stderr.write("error: tracebacks too long\…
Awesome. Thank you kindly.
> error: tracebacks too long
I like your style.