3 ms·
Python has had type annotations for a decade, and modern IDEs can interpret them. Writing `query: SQL = t"SELECT ..."` is a small price to pay for such a DX bo
by pphysch 1y ago
Python has had type annotations for a decade, and modern IDEs can interpret them.
Writing `query: SQL = t"SELECT ..."` is a small price to pay for such a DX boost.
- florbnit 1y agoI mean yes, so t-strings add nothing. You could already do everything you are proposing t-strings will make easier with just strings or f-strings. ‘query: SQL “Select …”’ “Wait” you’ll say “then the function taking the string has to parse the string and will have to add ugly logic grabbing variables from globals()!” Ah yes. That’s such an ugly solution… let’s instead codify just that as the official best practice and sell people on it by prefixing a t to the string so they don’t notice…