Formalizing f-strings
Formalizing f-strings
Posted Jan 11, 2023 2:31 UTC (Wed) by JoeBuck (subscriber, #2330)In reply to: Formalizing f-strings by KaiRo
Parent article: Formalizing f-strings
It's a similar issue, I think, to shadowing in C/C++. We can have
int foo; code; if (condition) { double foo; use(foo); }and the behavior is well-defined but not recommended, so we have -Wshadow. The {...} in an f-string is a similar kind of inner scope. Re-use of the same quote character can be confusing and perhaps might produce a warning, but it's not difficult to parse, and forbidding it can be more work than letting it pass.