How can I make handling multiple {}.get('value', {}.get('foo')) pretty? I ran into an issue where I was doing this:

dictionary1 = {}
dictionary2 = {}
foo = dictionary1.get('foo', dictionary1.get('bar', dictionary2.get('baz')))


I.e. if the value isn't supplied in one dict, it would fall back on the next and then on the next. In this case dictionary1 has a key that is deprecated that I'm getting in case the new style on isn't there, dictionary2 is completely different. It looks pretty ugly though, the alternative seem to be to break it up across multiple lines like:

foo = dictionary2.get('baz')
foo = dictionary1.get('bar', foo)
foo = dictionary1.get('foo', foo)


Which might be better, though it seems like it could be confusing to read the code in the reverse order. I wonder if there's an alternative more straight forward and prettier solution?
Your code attempts to fetch the values of all keys when it probably only really needs one.  You do not want to be doing this.

I think it would be better to create a list representing the priorities of what values you wish to retrieve and attempt to retrieve them.

def get_value(priorities):
    for key, dictionary in priorities:
        try:
            return dictionary[key]
        except KeyError:
            pass
    return None

priorities = [
    ('foo', dictionary1),
    ('bar', dictionary1),
    ('baz', dictionary2),
]
foo = get_value(priorities)