←back to thread

620 points tambourine_man | 1 comments | | HN request time: 0.001s | source
Show context
pragma_x ◴[] No.43750845[source]
Debate around the usefulness aside, are there any linter rules for warning about f-strings in light of this? I can easily see where mistaking one for the other would cause problems. For context, I'm thinking specifically about tools like Black and MyPy.
replies(2): >>43751430 #>>43752295 #
1. xixixao ◴[] No.43752295[source]
The runtime and static type of the template string is different to fstring (Template vs str). Unless you’re passing them somewhere that accepts strings, you can’t go wrong.

I actually quite like the simplicity of this design over tagged literals in JS.