I think something like this is more pythonic: (secret_dict.pop(k) for k in secret_dict.keys() if secret_dict[k] is None)
What do you think Douglas?