by HL33tibCe7 · 4y ago · 0 comments
I highly doubt that people believed that f-strings worked this way. Far more likely is that, for example, the expression started as one line, then got split onto two, or some such similar scenario.
The variable in the second string gets highlighted (with slightly different color, but still) because it would still work with `str.format()`. GitHub doesn't seem to do this.
'a' is str
b'a' is bytes
f'something' might be a separate f-str-type too?
1 is an int
1.2 is a float
(1.2 + 1) is a float
I would use such a feature, as I always use f-strings when formatting.
Because it would break existing strings containing braces, such as those used with `str.format`, or string.Template, or literal Jinja templates, ...
f-strings, like r-strings, have uses, but, like r-strings, I wouldn't want to replace plain strings with them.
Might also be a performance penalty for always having to run the fstring parser.
raise SomeError(
"Explanation... "
"yet more explanation"
)
To this: raise SomeError(
"Explanation... " "yet more explanation"
)
That just looks odd. Black is fantastic, but not perfect.