Skip to content

Commit ee484de

Browse files
committed
Make non-strict zip strict in printing.py
1 parent bf1e5d9 commit ee484de

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
@@ -925,18 +925,17 @@ def process(self, output, pstate):
925925
)
926926
idx = node.outputs.index(output)
927927
pattern, precedences = self.patterns[idx]
928-
precedences += (1000,) * len(node.inputs)
928+
precedences += (1000,) * (len(node.inputs) - len(precedences))
929929

930930
def pp_process(input, new_precedence):
931931
with set_precedence(pstate, new_precedence):
932932
r = pprinter.process(input, pstate)
933933
return r
934934

935935
d = {
936-
str(i): x
937-
for i, x in enumerate(
938-
pp_process(input, precedence)
939-
for input, precedence in zip(node.inputs, precedences, strict=False)
936+
str(i): pp_process(input, precedence)
937+
for i, (input, precedence) in enumerate(
938+
zip(node.inputs, precedences, strict=True)
940939
)
941940
}
942941
r = pattern % d

0 commit comments

Comments
 (0)