summaryrefslogtreecommitdiff
path: root/doc/data/messages/c/consider-using-f-string/details.rst
blob: 6b2d0e48ba1103a1fcb7e807e2f767cade00095a (plain)
1
2
3
4
5
6
7
Formatted string literals (f-strings) give a concise, consistent syntax
that can replace most use cases for the ``%`` formatting operator,
``str.format()`` and ``string.Template``.

F-strings also perform better than alternatives; see
`this tweet <https://twitter.com/raymondh/status/1205969258800275456>`_ for
a simple example.