Serhiy Storchaka added the comment: Proposed patch adds the BUILD_STRING opcode and speeds up PyObject_Format() in common cases. It makes f-strings the fastest method for simple formatting.
$ ./python -m timeit -s "x = 2" -- 'f"X is {x}"' 1000000 loops, best of 3: 0.347 usec per loop ---------- Added file: http://bugs.python.org/file43708/fstring_build_string.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27078> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com