News for hackers. Stuff that matters.
Re:Python's new t-strings by dragonwriter on Monday April 21, 2025 @01:05PM (#43754093)
> and an extra function can confirm the safety of a value going into a f-string just as well.

Yes, you could require consumers to explicitly sanitize each parameter before it goes into the f-string, or, because it has the structure of what is fixed and what is parameters, it can do all of that for all parameters when it gets a t-string.

The latter is far more reliable, and you can't do it with an f-string because an f-string after creation is just a static string with no information about construction.

There are no comments on this comment yet.