Skip to content

ALL-STRI1001 · string_construction_mechanism

Select a string mechanism from explicit construction requirements.

This is a contextual rule for all languages. Read its implementation.

Ask the selected judgment backend for four independently cited construction facts and reduce them through a fixed decision table. The model identifies requirements but never chooses the mechanism. Literals own static text, f-strings own local expressions, str.join owns Python iterables, string.Template owns simple external placeholders, and Jinja2 owns template logic or contextual markup escaping. minimum_characters limits contextual judgment to substantial string expressions.

The frozen bundle cites the string boundary, its authors, dynamic values, iteration ownership, control flow, and escaping requirements. Missing, duplicate, conflicting, or uncited answers remain unknown and reduce to uncertain.

SQL, shell, regular-expression, logging, localization, and security-sensitive APIs retain their own parameterization contracts. Ruff UP031, UP032, FLY002, and ISC003 plus Pylint R1713 retain direct syntax diagnostics.

f"Hello {user.name}" is an f_string. Rendering rows in Python and joining them is f_string_join. An HTML email with template loops and escaping is jinja2.

  • Cites “PEP 498, Literal String Interpolation”. Open reference
  • Cites “The Python Standard Library”, string.Template. Open reference
  • Cites “Jinja documentation”, template designer. Open reference
  • Cites “PEP 8, Style Guide for Python Code”, programming recommendations for str.join. Open reference