Never really understood why not all strings were f-strings in python.
Never really understood why not all strings were f-strings in python.
For conditional formatting (where you don't know if the formatting is needed or the contents of what you're formatting into the string but you know what you want to format), f-strings also lose their use pretty much immediately.
They're great for a quick inline format but less useful for things like string templates you want to use over and over.
I like having different types of strings with different sets of magic characters. Even having identical `'` and `"` strings just to avoid backslashes in a few cases is great.
Now? Maybe because another breaking change in strings is the worst nightmare of the current generation of Python developers.
Sometimes you don't want interpolation, and it seems more reasonable to default to a version without such a feature than to default to a version with it and have an alternate syntax for non-interpolated strings. Or, at least, that makes sense to me, but I have no knowledge of their motivations.
If Python were designed from scratch today, I suspect it'd do something similar to JS.