param.reactive.reactive_ops.is_not#

reactive_ops.is_not(other) rx[source]#

Perform a logical “is not” comparison with the given operand.

This method checks if the current object is not the same object (i.e., not identical in memory) as the given operand. The result is returned as a new reactive expression.

Parameters:

other (any) – The operand to compare for non-identity.

Returns:

A new reactive expression representing the result of the “is not” comparison.

Return type:

rx

Examples

Check if a reactive value is not the same object:

>>> import param
>>> obj1 = object()
>>> obj2 = object()
>>> rx_obj = param.rx(obj1)
>>> rx_is_not = rx_obj.rx.is_not(obj2)
>>> rx_is_not.rx.value
True

Compare with the same object:

>>> rx_is_not = rx_obj.rx.is_not(obj1)
>>> rx_is_not.rx.value
False

Update the reactive value and re-check non-identity:

>>> rx_obj.rx.value = obj2
>>> rx_is_not.rx.value
True