[issue36798] f-strings do not support top-level :=

Serhiy Storchaka report at bugs.python.org
Sun May 5 12:51:18 EDT 2019


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

f-strings are defined and used at the same place, as any other expression. You can not save an f-string to a variable, as you can not save a multiplication. But you can save a string which is a result of the f-string evaluation.

Perhaps you were fooled by the name of f-strings. It looks as a special kind of strings, but actually it is a kind of expressions, like addition or multiplication.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36798>
_______________________________________


More information about the Python-bugs-list mailing list