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

Anders Hovmöller boxed at killingar.net
Wed Apr 10 06:15:53 EDT 2019



> On 10 Apr 2019, at 11:55, Krokosh Nikita <de.lsnk at gmail.com> wrote:
> 
> I need smth like starstarmap('{a} / {b}/ {c}'.format, [{a:1, b:2, c:3}, {a:4, b:5, c:6}, ...])

Seems overly specific. Why not merge the dicts then call formal like normal?

>> On 4/10/19 7:48 PM, Anders Hovmöller wrote:
>> I don't really understand. You can do:
>> 
>> '{a} {b}'.format(**{'a': 1}, **{'b': 2})
>> 
>> Is that what you want?
>> 
>>> On 10 Apr 2019, at 11:09, Krokosh Nikita <de.lsnk at gmail.com> wrote:
>>> 
>>> Hello. I have a following question: How come there's no such thing in Python like starmap but which unpacks dicts as kwargs for fuction?
>>> 
>>> For example I have a format string like "{param1}, {param2}" and want to get results passing list of dicts for it's .format().
>>> 
>>> Of course I can do that with genexpr or some lambda with map.
>>> 
>>> But can you clarify why starmap version of map fuction exists and doublestarmap doesn't?
>>> 
>>> 
>>> Best Regards.
>>> 
>>> _______________________________________________
>>> Python-ideas mailing list
>>> Python-ideas at python.org
>>> https://mail.python.org/mailman/listinfo/python-ideas
>>> Code of Conduct: http://python.org/psf/codeofconduct/


More information about the Python-ideas mailing list