param.reactive.reactive_ops.upstream#
- reactive_ops.upstream() Iterator[rx][source]#
Iterate over the
rxnodes this expression derives its value from, directly or transitively, excluding itself. Pipeline edges count:.rx.pipe/operator chaining, a branch (expr[0]), anrxpassed as an operation argument, and anrxreached through aParameter(allow_refs=True). An input masked by.rx.overrides, including the one chained from, is replaced by its override. A dependency reached only throughbind(),.rx.when, or.rx.whereis not included.Traversal order is unspecified and may change between calls as the pipeline is extended. Do not use
inon the iterator to test membership:rx.__eq__builds a comparison expression rather than a bool, sox in upstream()is not a reliable membership test. Usex in set(upstream())instead.- Returns:
Empty if the
.rxnamespace does not belong to anrxnode.- Return type:
Iterator[rx]
Examples
>>> import param >>> a = param.rx(1) >>> b = a.rx.pipe(lambda x, y: x + y, y=param.rx(2)) >>> a in set(b.rx.upstream()) True