MCPcopy Create free account
hub / github.com/ActiveState/code / maps

Function maps

recipes/Python/498264_reduce_as_a_generator/recipe-498264.py:73–73  ·  view source on GitHub ↗
(f)

Source from the content-addressed store, hash-verified

71#
72
73>>> def maps(f):
74... return lambda x, y: x+[f(y)] if isinstance(x, list) else [f(x),f(y)]
75
76>>> stm = greduce(maps(lambda x:x+10),[1,2,3,4])

Callers 1

recipe-498264.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected