Steven D'Aprano <steve+pyt...@pearwood.info> added the comment:
If you want pass to become an expression, what should these do? x = pass print(pass) mydict[pass] = 1 type(pass) There is nothing special about the ternary if operator. It is just an operator like plus, minus and more. The only difference is that plus takes two arguments, and if...else takes three: expression + expression expression if expression else expression If pass becomes legal in the if...else ternary operatory, it must be an expression, so it must have a value. What is that value? ---------- title: 'pass' in 'if-else' linear expression -> operator 'pass' in 'if-else' linear expression _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue45456> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com