▲ | davepeck 9 days ago | |||||||
For one thing, `f"something"` is of type `str`; `t"something"` is of type `string.templatelib.Template`. With t-strings, your code can know which parts of the string were dynamically substituted and which were not. | ||||||||
▲ | all2 9 days ago | parent | next [-] | |||||||
The types aren't so important. __call__ or reference returns type string, an f and a t will be interchangeable from the consumer side. Example, if you can go through (I'm not sure you can) and trivially replace all your fs with ts, and then have some minor fixups where the final product is used, I don't think a migration from one to the other would be terribly painful. Time-consuming, yes. | ||||||||
| ||||||||
▲ | 9 days ago | parent | prev [-] | |||||||
[deleted] |