I’ve been reading https://www.python.org/dev/peps/pep-0501/ and this confuses me:
The parsed template consists of a tuple of 2-tuples, with each 2-tuple containing the following fields:
- leading_text: a leading string literal. This will be the empty string if the current field is at the start of the string, or immediately follows the preceding field.
- field_expr: the text of the expression element in the substitution field. This will be None for a final trailing text segment.
I see that it’s doing that, but it doesn’t seem to explain why that particular structure.