there is a ternary expression since python 2.5 , so i would prefer: ``action = action if action.strip() else None``