there is already work underway somewhere for a backport of strings.Template for python versions older than 3.14
if there isn’t, if anyone has advice on how to make that happen.
I am working on ibis, which is a dataframe API that generates and then executes SQL on various underlying SQL engines. In this recent issue, I think I came across a good use case for strings.Template. But, I want to make this available to users who aren’t using 3.14+.
So, I was wondering if there was a backport for these older python versions, and then we could make ibis accept either implementation (probably using a Protocol for the type hints).
I’m pretty sure you’re not referring to the string.Template class, which has been around for a very long time and needs no backporting. Are you asking about string.templatelib which is new in Python 3.14?
Template strings are a new feature in Python 3.14 (not yet released). As such, it won’t be backported by us to a previous version. It might be possible to use tricks à la future-fstrings to do so, but this would be a third-party endeavour. I’m not aware of anyone else who has asked about doing this yet.