[issue28308] Accelerate 'string'.format(value, ...) by using formatted string literals

2020-02-14 Thread Batuhan Taskaya
Change by Batuhan Taskaya : -- nosy: +BTaskaya ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue28308] Accelerate 'string'.format(value, ...) by using formatted string literals

2017-12-25 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- assignee: -> serhiy.storchaka ___ Python tracker ___

[issue28308] Accelerate 'string'.format(value, ...) by using formatted string literals

2016-09-29 Thread Eric V. Smith
Eric V. Smith added the comment: One thing to be careful of here is that there's one slight difference between how str.format() and f-strings handle indexing of values. f-strings, of course, use normal Python semantics, but str.format() treats indexing by things that don't look like integers

[issue28308] Accelerate 'string'.format(value, ...) by using formatted string literals

2016-09-29 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- dependencies: +Build-out an AST optimizer, moving some functionality out of the peephole optimizer ___ Python tracker

[issue28308] Accelerate 'string'.format(value, ...) by using formatted string literals

2016-09-29 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: For now using formatted string literals (PEP498) is the fastest way of formatting strings. $ ./python -m perf timeit -s 'k = "foo"; v = "bar"' -- '"{!s} = {!r}".format(k, v)' Median +- std dev: 3.96 us +- 0.17 us $ ./python -m perf timeit -s 'k = "foo";