param.reactive.reactive_ops.inputs#

reactive_ops.inputs() → dict[int | str, rx][source]#

Return the rx nodes this node’s operation is applied to.

Keys match .rx.overrides: keyword arguments by name, positional arguments by their position in the call, which includes the node this one was piped from. An input overridden by an rx node reports that node; one overridden by a plain value is left out. Not included: non-rx arguments, rx nodes nested in a container, and the arguments of a bind() function.

Inside an operation, param.current_node().rx.inputs() gives the nodes that fed it, e.g. to read their .rx.meta (see .rx.generation).

Returns:

A new dict on every call; empty for a node without an operation.

Return type:

dict[int | str, rx]

Examples

>>> import param
>>> a, b = param.rx(1), param.rx(2)
>>> expr = a.rx.pipe(lambda x, *, y: x + y, y=b)
>>> expr.rx.inputs()[0] is a, expr.rx.inputs()['y'] is b
(True, True)