Assuming connectionDetails
is a Python dictionary, what's the best, most elegant, most "pythonic" way of refactoring code like this?
if "host" in connectionDetails:
host = connectionDetails["host"]
else:
host = someDefaultValue
Like this:
host = connectionDetails.get('host', someDefaultValue)