["python","ruby"]
Does Python have an "or equals" function like ||= in Ruby?

If not, what is the best way to do this? Right now I'm doing (for a django project): if not 'thing_for_purpose' in request.session: request.session['thing_for_purpose'] = 5 but its pretty awkward. In Ruby it would be: request.session['thing_for_purpose'] ||= 5 which is much nicer.
Jon-Eric's answer's is good for dicts, but the title seeks a general equivalent to ruby's ||= operator. A common way to do something like ||= in Python is x = x or new_value