3 ms·
Be Careful with Python's New-Style String Format
- raymondh 10y agoFor user defined templates, using string.Template() is a good alternative because it does not do multi-level attribute lookups. The single mapping lookup is safer. Also, the syntax is simpler, making it more suitable for exposure to end users and making it less hackable.