From dafacf25aeab1365a30814ec9a8c998f5178cd9e Mon Sep 17 00:00:00 2001 From: Lucas Mirelmann Date: Mon, 15 Dec 2025 20:52:20 +0100 Subject: [PATCH] Clarified string interpolation with single component Clarified the precedence in how `args` is handled when trying to interpolate a string with a single component. --- spec.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spec.md b/spec.md index 7707b3e..f4c571e 100644 --- a/spec.md +++ b/spec.md @@ -2356,9 +2356,10 @@ it is immediately followed by another `%`, in which cases both characters together denote a single literal percent sign. The conversion's operand is the next element of `args`, -which must be a tuple with exactly one component per conversion, -unless the format string contains only a single conversion, in which -case `args` itself is its operand. +which must be a tuple with exactly one component per conversion. +If a single conversion is required, `args` may be a single non-tuple object. +In order to format a single component with a single tuple, +`args` must be a tuple whose only element is the tuple to be represented. Starlark does not support the flag, width, and padding specifiers supported by Python's `%` and other variants of C's `printf`.