TryExpression#

Added in version 4.22.

class TryExpression(*args, **kwargs)#

Superclasses: Expression

A GtkExpression that tries to evaluate each of its expressions until it succeeds.

If all expressions fail to evaluate, the GtkTryExpression's evaluation fails as well.

Constructors#

class TryExpression
classmethod new(expressions: list[Expression]) TryExpression#

Creates a GtkExpression with an array of expressions.

When evaluated, the GtkTryExpression tries to evaluate each of its expressions until it succeeds. If all expressions fail to evaluate, the GtkTryExpression's evaluation fails as well.

The value type of the expressions in the array must match.

Added in version 4.22.

Parameters:

expressions – The array of expressions