On Fri, Sep 18, 2020, 2:22 AM Ricky Teachey

> On Fri, Sep 18, 2020, 6:35 AM Alex Hall
>
>> The point is that this:
>>
>
>>     (a, b) = c
>>
>> is 'assigning to a literal' just as much as this:
>>
>>     f"{a} {b}" = c
>>
>> Both are just things that look like expressions with dynamic values but
>> aren't.
>>
>
> I agree with you. It's not that whacky in principle. But it still looks
> very odd.
>

Alex draws a very unlikely and toy example of f-string as assignment
target. For that, we already have the more clear `c.split()` that does the
same thing as the example.

I never put parentheses on the LHS as in the example. But even with them
added unnecessarily, it's short and immediately obvious what gets assigned
to.

This is not remotely true for f-string target. A better example is:

f"""Buried, somewhere, in this string is a mention of {a},
and somewhere else, a mention of {b}. We leave out (c)
from this example though. If the RHS gets a dot or tittle
wrong we won't wind up assigning,
which is {adjective}!""" = c

Looking at the LHS and RHS is followed by a laborious copy editor's
attention to try to figure out whether it is an assignment or not. It is
painfully easy to get the RHS subtly wrong, so no assignment happens (what
DOES happen remains unclear in the discussion)


>
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/6FFKMHSDBD4Z6EM6ALK7Z63QOCAMYEZB/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to