Thanks again for all the feedback and discussion. Based on this conversation, we made the following further updates to the PEP:
Template.argsis gone; interleaving is no longer discussedTemplate.stringsand.interpolationsare the primary tuplesTemplate.__iter__surfacesstr | Interpolationin any order (not necessarily interleaved) and omits empty strings- Dropped
__eq__and__hash__ - Changed
templatelibtoTBDfor now, until a decision can be made - Added a note about
__repr__
These are merged; you can read PEP 750 here.
There were a couple suggestions about naming in this (and the previous) discussion thread:
- Consider renaming
InterpolationtoField(and.interpolationsto.fields) - Consider renaming
.stringsto.literals(with an eye towards future bytes templates)
I don’t feel strongly but if I were forced to bikeshed I might choose “Field” – less typing! – and probably would keep .strings because I’m old and think about byte strings anyway. ![]()