3 ms·
It's not really, because there is no straightforward way to express something like: def f(): bar() try: foo() catch KeyError as exc:
by Carpetsmoker 7y ago
It's not really, because there is no straightforward way to express something like:
def f():
bar()
try:
foo()
catch KeyError as exc:
print(exc)
Calling recover() in a defer applies to the entire function, so you'll need to wrap foo() in an anonymous function. You also need more work to not use "Pokemon exceptions" (gotta catch 'em all) and recover() only KeyError