Re:Python's new t-strings
by Dx5IQ on Monday April 21, 2025 @10:33AM
(#43752466)
Such library functions tend to also accept a string as a valid input. E.g. db.execute from the GP usually works with strings to allow non-parametrized SQL queries.
[ Parent
| on HN ]
The library should just refuse strings. If a non parametrized query is desired, it could require the user to supply a t-string with no {}.
Re:Python's new t-strings
by dragonwriter on Wednesday April 23, 2025 @02:29AM
(#43769225)
> Such library functions tend to also accept a string as a valid input.
Also? They tend only to accept a string (possibly with some additional arguments, if there is an in-library way to handle parameterization) as input, because Template literally hasn't been an option. New APIs designed with Template available will look different.