[Python-ideas] Allow specifying list of functions to `map`

MRAB python at mrabarnett.plus.com
Sun Mar 30 21:06:25 CEST 2014


On 2014-03-30 18:59, Ram Rachum wrote:
> If `map` accepted a tuple for its first argument, things like this:
>
>      stdout, stderr = map(str.strip, map(bytes.decode, popen.communicate()))
>
> Could become this:
>
>      stdout, stderr = map((bytes.decode, str.strip), popen.communicate())
>
I think that the problem there is that it's not obvious in what order
they are applied. You could, for example, argue that map((f, g) x)
should do map(f, map(g, x) rather than map(g, map(f, x)).


More information about the Python-ideas mailing list