In one of my classes I have a number of methods that all draw values from the same dictionaries. However, if one of the methods tries to access a value that isn\'t there, it
I believe the .get() method of a dict has a parameter for setting the default value. You could use that and have it in one line. I'm not sure how it affects performance though.