Hi,
is it currently possible to match TupleGetItem for an arbitrary index? if not, would it be a permissible patch to add this (maybe with index=-1 internally and a second constructor facing the public)?
Best regards
Thomas
Hi,
is it currently possible to match TupleGetItem for an arbitrary index? if not, would it be a permissible patch to add this (maybe with index=-1 internally and a second constructor facing the public)?
Best regards
Thomas
As you mentioned, that will need to extend the TupleGetItemPattern
to allow unspecified index. Currently I can only come up with the following workaround:
op = is_op(...)
out = is_tuple_get_item(op, 0) | is_tuple_get_item(op, 1) | is_tuple_get_item(op, 2)
cc @mbrookhart
@t-vi Sure, if you want to extend it, Iām okay with that. Iām not sure we need an extra API, maybe just make the arbitrary value default?
Yeah. I would suggest enhancing the current one to is_tuple_get_item(pat: DFPattern, index: Optional[int] = None)
.
Thank you.
Best regards
Thomas