STINNER Victor <victor.stin...@gmail.com> added the comment:

Oh, I forgot the benchmark script:
------------
$ cat ~/bench_format.sh 
./python -m timeit \
    -s 'fmt="{}:"; arg="abc"' \
    'fmt.format(arg)'
./python -m timeit \
    -s 'N=200; L=3; fmt="{}"*N; args=("a"*L,)*N' \
    'fmt.format(*args)'
./python -m timeit \
    -s 's="x=%s, y=%u, z=%x"; args=(123, 456, 789)' \
    's.format(*args)'
./python -m timeit \
    -s 's="The {k1} is {k2} the {k3}."; args={"k1": "x", "k2": "y", "k3": "z"}' 
\
    's.format(**args)'
------------
(based on the one used for #14687, see msg159822)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue14716>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to