Remix.run Logo
zahlman 8 days ago

Yes. Just like with f-strings, the call to `fib_slow()` is extracted at compile-time, and occurs eagerly at run-time.

What t-strings offer over f-strings is the ability to control how the final string is put together from the calculated results. And the t-string doesn't have `__str__` - you have to explicitly pass it to a named formatting function to get a string. (There is `__repr__, but that's for debugging, of course.) So you can potentially reuse the same Template instance (created from the t-string) multiple times in different contexts to format the same information different ways.