Actually, that's close to what I'd probably write (though not always; context is everything, and I'd do "except KeyError" not bare except, of course). Though the reason for that is that I wouldn't call the variable tmpvar; I'd give it a meaningful name, and think of it as an opportunity to write more self-documenting code.
I don't think I've ever come across this in practice, though; normally, I just work with dicts which either don't contain None, or where None would be expected to be treated the same as the entry being missing.
I don't think I've ever come across this in practice, though; normally, I just work with dicts which either don't contain None, or where None would be expected to be treated the same as the entry being missing.