Comment on The Ultimate Guide to Error Handling in PythonparentComments−alfons_foobar1yJust write: if key not in table: return default_value value = table[key] I think this could/should be shortened to value = table.get(key, default_value) ... return value No?In case you disagree, I'd be happy to hear your thoughts!
Comments
In case you disagree, I'd be happy to hear your thoughts!