On Thu, Jun 24, 2021 at 10:34 AM micro codery <[email protected]> wrote:
> As pointed out already, f-strings and format are subtly different (not
> counting that one can eval and the other cannot). Besides quoting, the
> f-sting mini language has diverged from format's
> >>> spam="Spam"
> >>> f"{spam=}"
> "spam='Spam'"
> >>> "{spam=}".format(spam=spam)
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> KeyError: 'spam='
>
Eric, what would you think of adding this feature to format()? It seems
doable (at least for keyword args -- for positional args I don't think it
makes sense).
Honestly, the rest of the discussion belongs on python-ideas.
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*
<http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/>
_______________________________________________
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/PAWYT7P5OJXFYHHLBUEJGLDBNL4D55ZT/
Code of Conduct: http://python.org/psf/codeofconduct/