Python-ify logical operators