Get
get
¶
Fetches the value of a retriever. If the resulting value is an int
, it's result can be manipulated with int
operations. For example, get(Struct1.sub_struct1, SubStruct1.sub_list1, 1, SubStruct2.property)+1
is like doing
struct1.sub_struct1.sub_list1[1].property+1
Parameters:
-
*source
(Retriever | int
, default:()
) –The retriever path to fetch the value from. This can be a sequence of retrievers/list indices starting in the current struct
Returns:
-
Get
–An instance encoding the retriever path and manipulations to perform during parsing
Raises:
-
ValueError
–If the value at the source path is not an
int
, andint
operations are attempted
get_len
¶
Fetches the length of a list-valued retriever. It's result can be manipulated with operations. For example,
get_len(Struct1.sub_struct1, SubStruct1.sub_list1)-1
is like doing len(struct1.sub_struct1.sub_list1)-1
Parameters:
-
*source
(Retriever | int
, default:()
) –The retriever path to fetch the value from. This can be a sequence of retrievers/list indices starting in the current struct
Returns:
-
Get
–An instance encoding the retriever path and manipulations to perform during parsing
Raises:
-
ValueError
–If the value at the source path is not a list
Get
¶
Encodes and performs manipulations on retriever values before passing them to combinators as inputs. For example, it can be used to add the value of two retrievers.