Error de sintaxis con operador ternario.

Soy nuevo en Python y estoy tratando de usar un opertor ternario que tiene este formato (creo que sí)

value_true if <test> else value_false

Aquí hay un fragmento de código:

expanded = set()

while not someExpression:

    continue if currentState in expanded else expanded.push(currentState)

    # some code here

Pero a Python no le gusta y dice:

SyntaxError: invalid syntax (pointed to if)

¿Como arreglarlo?

Respuestas a la pregunta(1)

Su respuesta a la pregunta