if 'name' in my_dict: name = my_dict.pop('name') else: name = None