diff --git a/pymbolic/primitives.py b/pymbolic/primitives.py index c6c6d08963a4208aa7d5c9444eec9ea952dce8d2..9c8debc4c97bafc667c069ed4ae7ff54ad0df963 100644 --- a/pymbolic/primitives.py +++ b/pymbolic/primitives.py @@ -648,8 +648,8 @@ class ExpressionNode: return Subscript(self, subscript.child) if subscript == (): - warn("Expression.__getitem__ called with an empty tuple as an index. " - "This still returns just the aggregate (not a Subscript), " + warn(f"{type(self).__name__}.__getitem__ called with an empty tuple as " + "an index. This still returns just the aggregate (not a Subscript), " "but this behavior will change in 2026. To avoid this warning " "(and return a Subscript unconditionally), wrap the subscript " "in pymbolic.primitives.EmptyOK.", DeprecationWarning, stacklevel=2)