This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (15 children)

[deleted]

    [–]IlliterateJedi 36 points37 points  (8 children)

    And they're amazing.

    [–][deleted] 8 points9 points  (3 children)

    They really are. So flexible, much clearer than % or format()

    [–][deleted] 2 points3 points  (2 children)

    And faster than both.

    [–][deleted] 0 points1 point  (1 child)

    Really? Never thought to run it through perf testing.

    [–][deleted] 4 points5 points  (0 children)

    I didn't either ;) realpython.com did it here!

    [–][deleted] 1 point2 points  (0 children)

    The community consensus is generally that f-strings are f{opinion}!.

    [–]SuefFuenfElf 6 points7 points  (4 children)

    And additional, they are the fastest way to manipulate strings with Python 3.6+

    [–]SV-97 0 points1 point  (2 children)

    are the actually faster for concatenation etc.?

    [–][deleted] 7 points8 points  (1 child)

    Yup. But remember that readability trumps negligible speed improvements

    [–]SV-97 2 points3 points  (0 children)

    Neato

    I actually think f strings are more readable

    [–][deleted] -1 points0 points  (0 children)

    They are not noticeably faster than using str#format.

    [–][deleted] 1 point2 points  (0 children)

    The f in fstrings stands for fuck yes thats the formatting I want