I like the idea of T Strings and here is a toy example:
name: str = 'Bob' age: int = 30 template = t'Hello, {name}! You are {age} years old.' print (template.strings) print(template. interpolations) print(template. values) ('Hello, ', '! You are ', ' years old.') (Interpolation('Bob', 'name', None, ''), Interpolation(30, 'age', None, '')) ('Bob', 30)But why isn't there a
print(template.render)
# → 'Hello, Bob! You are 30 years old.'
[link] [comments]









English (US) ·