> On Feb 7, 2022, at 1:55 AM, Chris Angelico <ros...@gmail.com> wrote:
> 
…
> def spam():
>    bird = "Norwegian Blue"
>    volts = 4e6
>    return "{volts}V insufficient to voom {bird}".format(**locals())

This is completely off topic, but: the better way to do this is with 
.format_map(locals()).

This public service announcement is part of my goal to increase knowledge of 
format_map(). 

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/546JXWP7JCXQ3GLAUQYE77FM2DYCCHBU/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to