Example of subclassing string.Template in Python?
问题 I haven't been able to find a good example of subclassing string.Template in Python, even though I've seen multiple references to doing so in documentation. Are there any examples of this on the web? I want to change the $ to be a different character and maybe change the regex for identifiers. 回答1: From python docs: Advanced usage: you can derive subclasses of Template to customize the placeholder syntax, delimiter character, or the entire regular expression used to parse template strings. To