@@ -70,7 +70,7 @@ def _repr_pretty_(self, p, cycle):
7070import types
7171import warnings
7272from collections import Counter , OrderedDict , defaultdict , deque
73- from collections .abc import Callable , Generator , Iterable , Sequence
73+ from collections .abc import Callable , Collection , Generator , Iterable , Sequence
7474from contextlib import contextmanager , suppress
7575from enum import Enum , Flag
7676from functools import partial
@@ -554,6 +554,7 @@ def repr_call(
554554 arg_slices : ArgLabelsT | None = None ,
555555 leading_comment : str | None = None ,
556556 avoid_realization : bool = False ,
557+ known_safe_to_repr : Collection [str ] = (),
557558 ) -> None :
558559 """Helper function to represent a function call.
559560
@@ -619,7 +620,7 @@ def repr_call(
619620 entry = comments .get (label )
620621 if entry :
621622 self ._commented_slices .add (entry [1 ])
622- if avoid_realization :
623+ if avoid_realization and label not in known_safe_to_repr :
623624 self .text ("<symbolic>" )
624625 else :
625626 self .pretty (v )
0 commit comments