Hi Evan,

f-strings support a version of this. If you put an equals sign at the 
end of the expression in your f-string (possibly with white space) then 
the f-string will include both the expression itself and its value in 
the result:

    >>> a = 12; b = 13
    >>> f'{a == b}'
    'False'
    >>> f'{a == b = }'
    'a == b = False'


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

Reply via email to