Replace `if_else` utility function with Python 2.5+'s conditional expression syntax

Not sure if this project has a target Python version, but if we can safely assume everyone has at least 2.5 now, we can use Python's own conditional expression.