Skip to content

Commit c28cc2f

Browse files
committed
Make non-strict zip strict in printing.py
1 parent bb5fbd6 commit c28cc2f

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

pytensor/printing.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -930,18 +930,17 @@ def process(self, output, pstate):
930930
)
931931
idx = node.outputs.index(output)
932932
pattern, precedences = self.patterns[idx]
933-
precedences += (1000,) * len(node.inputs)
933+
precedences += (1000,) * (len(node.inputs) - len(precedences))
934934

935935
def pp_process(input, new_precedence):
936936
with set_precedence(pstate, new_precedence):
937937
r = pprinter.process(input, pstate)
938938
return r
939939

940940
d = {
941-
str(i): x
942-
for i, x in enumerate(
943-
pp_process(input, precedence)
944-
for input, precedence in zip(node.inputs, precedences, strict=False)
941+
str(i): pp_process(input, precedence)
942+
for i, (input, precedence) in enumerate(
943+
zip(node.inputs, precedences, strict=True)
945944
)
946945
}
947946
r = pattern % d

0 commit comments

Comments
 (0)