4 ms·
Format strings aren't a template language (Python even has Template Strings for that purpose), and being able to do this is quite useful in eg. debug logs it's
by dom0 10y ago
Format strings aren't a template language (Python even has Template Strings for that purpose), and being able to do this is quite useful in eg. debug logs it's a shorter and easier to write "{foo.x} ({foo.__class__.__name__})".format(foo=something).
Conversely they don't prohibit expensive properties either (eg. ORM-based lookups), or generating misleading output or whatever.