私はPythonが初めてで、この形式の三項演算子を使用しようとしています(そう思います)
value_true if <test> else value_false
コードのスニペットを次に示します。
expanded = set()
while not someExpression:
continue if currentState in expanded else expanded.push(currentState)
# some code here
しかし、Python はそれを好まず、次のように言います。
SyntaxError: invalid syntax (pointed to if)
修正方法は?