On Fri, Sep 18, 2020 at 12:15 PM David Mertz <[email protected]> wrote:
>
> On Thu, Sep 17, 2020, 4:04 PM Chris Angelico
>>
>> > >>> my_string = "It might be 11:45 PM"
>> > >>> # ... many lines later ...
>> > >>> f"It is {hh}:{mm} {am_or_pm}" = my_string
>> >
>> > What are hh, mm, and am_or_pm now?  Do we raise an exception?  Do we run 
>> > the line having no real idea whether they have been assigned at all? How 
>> > do we even check whether an assignment took place?
>>
>> You can get this with ANY unpacking form. I don't see how this is any 
>> different. In fact, this kind of usage - where the template is in the source 
>> code but the data comes from a variable - would be the normal
>
>
> So are you saying this would be a Value error like unsuccessful tuple 
> unpacking? That's not obvious from OP.

Either a ValueError or a partial assignment. There are arguments on
both sides. Whichever is decided on, it will make perfectly good sense
a lot of the time, and have to be worked against the rest of the time.
It's not an argument against the proposal as a whole.

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

Reply via email to