Is there a way in python to turn a try/except into a single line?
something like...
b = \'some variable\' a = c | b #try statement goes here <
b = \'some variable\' a = c | b #try statement goes here
In python3 you can use contextlib.suppress:
from contextlib import suppress d = {} with suppress(KeyError): d['foo']