Python one-line if/else statements should function without raising a SyntaxError, but with some keywords they do.
The expected results of pass if arg else pass should be similar to print('') if arg else print(''). While they appear similar, one results in a syntax error and the other does not. Why does the interpreter permit some keywords to be used this way and not others?
def foo(arg):
#raise BaseExecption if arg else raise BaseException
#pass if arg else pass
print('') if arg else print('')
foo(True)
Note: The commented out lines of code will generate a SyntaxError.