[Python-ideas] Starap function exists but it seems there's not such thing as "doublestarmap"

Serhiy Storchaka storchaka at gmail.com
Wed Apr 10 06:46:04 EDT 2019


10.04.19 12:55, Krokosh Nikita пише:
> I need smth like starstarmap('{a} / {b}/ {c}'.format, [{a:1, b:2, c:3}, 
> {a:4, b:5, c:6}, ...])

Use the format_map method of str.

 >>> list(map('{a} / {b}/ {c}'.format_map, [{'a':1, 'b':2, 'c':3}, 
{'a':4, 'b':5, 'c':6}]))
['1 / 2/ 3', '4 / 5/ 6']



More information about the Python-ideas mailing list