◐ Shell
clean mode source ↗

Message 250465 - Python tracker

Another version of that AST that is better for my digestion:

f'a={a}'

Module(body=[Expr(
    value=JoinedStr(values=[
        Str(s='a='),
        FormattedValue(
            value=Name(id='a', ctx=Load()),
            conversion=0,
            format_spec=None,
        ),
    ]),
)])

I have been reading over the test cases, and left a bunch of suggestions for more edge cases etc. Some of them might reflect that I haven’t completely learnt how the inner Python expression syntax, outer string escaping syntax, {{curly bracket}} escaping, automatic concatenation, etc, are all meant to fit together.