17 Sep
2020
17 Sep
'20
8:15 p.m.
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.