[Python-ideas] f-string literals by default?

Chris Angelico rosuav at gmail.com
Tue Dec 5 17:10:09 EST 2017


On Wed, Dec 6, 2017 at 8:59 AM, Joao S. O. Bueno <jsbueno at python.org.br> wrote:
> One more big NO here -
> strings are _data_  not code - this little fact had made
> Python easier to learn for decades.
> If you need interpolation, and therefore, code that is run in
> the context the string is declared, just use f-strings. But f-strings
> are not static data, they are objects aware of the point
> in the source code file they are declared -  a very different
> beast from ordinary strings.

To be technically accurate, an f-string isn't an object at all - it's
an expression. There's no way to refer to an unevaluated f-string.

ChrisA


More information about the Python-ideas mailing list