You can do something like
foo, bar = map(d.get, ('foo', 'bar'))
or
foo, bar = itemgetter('foo', 'bar')(d)
This may save some typing, but essentially is the same as what you are doing (which is a good thing).
You can do something like
foo, bar = map(d.get, ('foo', 'bar'))
or
foo, bar = itemgetter('foo', 'bar')(d)
This may save some typing, but essentially is the same as what you are doing (which is a good thing).