Formalizing f-strings
Formalizing f-strings
Posted Jan 10, 2023 23:25 UTC (Tue) by KaiRo (subscriber, #1987)Parent article: Formalizing f-strings
Posted Jan 11, 2023 2:31 UTC (Wed)
by JoeBuck (subscriber, #2330)
[Link]
Posted Jan 11, 2023 11:43 UTC (Wed)
by smurf (subscriber, #17840)
[Link]
It's a similar issue, I think, to shadowing in C/C++. We can have
Formalizing f-strings
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.
Formalizing f-strings