▲ | zahlman 8 days ago | |||||||
> What do we gain by the shorthand? Because it's new syntax, it allows for parsing the literal ahead of time and eagerly evaluating the substitutions. Code like
essentially gets translated into
That is: subsequent changes to `bar` won't affect the result of evaluating the template, but that evaluation can still apply custom rules. | ||||||||
▲ | stavros 7 days ago | parent [-] | |||||||
Ah OK, I see what you mean, so they're basically an f-string that hasn't been "baked in" yet, and you can still access all its parameters. That's pretty cool. | ||||||||
|