On 10/22/2020 10:15 AM, Chris Angelico wrote:
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.)

None of which changes my opinion that it's not worth making this into syntax. As I said, reasonable people can disagree. But I think I'll wait until I see a PEP before commenting more broadly.

Eric
_______________________________________________
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/TI5MDPIX3NUAHAYRSKVZA36UNG7FKISI/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to