[issue45456] operator 'pass' in 'if-else' linear expression

Steven D'Aprano report at bugs.python.org
Wed Oct 13 01:58:40 EDT 2021


Steven D'Aprano <steve+python at 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 <report at bugs.python.org>
<https://bugs.python.org/issue45456>
_______________________________________


More information about the Python-bugs-list mailing list