T Strings - Why there is no built in string rendering?

Posted by UsernamesArentClever@reddit | Python | View on Reddit | 59 comments

I like the idea of T Strings and here is a toy example:

cheese = "Brie"

template = t'We have {cheese} in stock.'

print(template.strings)

# → ('We have ', ' in stock.')

print(template.interpolations)

# → something like (Interpolation('Brie', 'cheese', None, ''),)

print(template.values)

# → ('Brie',)

But why isn't there a

print(template.render)

# → We have Brie in stock.