On Fri, Oct 23, 2020 at 1:11 AM Eric V. Smith <e...@trueblade.com> wrote: > And if all f-strings brought to the table was the ability to use simple > variables as the value to be formatted, I'd have been opposed to that as > well. What's the point of: > > f"{a} {b} {c}" > > when: > > "{} {} {}".format(a, b, c) > > does the same thing? This was literally one of the proposals considered > when f-strings were being designed, and I was opposed. >
The rationale in PEP 498 advocates the benefits even with just simple names. You don't have to be embedding complex expressions in order to benefit from f-strings. (Also, assignment targets don't have to be simple names; targets like "x[1]" or "x.y" would be perfectly valid. Although I doubt anyone would want to assign to "a,b,c" inside an expression like this.) ChrisA _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/PU4HC2JOHKJE74C6XS7PIHJ2P2CJIREX/ Code of Conduct: http://python.org/psf/codeofconduct/