> def cat(x): return x > > def multimap(func, s, n=2): > assert n > 0, "n must be positive" > return (map(func, seq) > if n == 1 else > map(lambda x: multimap(func, x, n-1), > seq)) > > def multifilter(func, s, n=2): > return multimap(lambda x: filter(func, x), s, n-1) > > def multireduce(func, s, n=2): > return multimap(lambda x: reduce(func, x), s, n-1) > > class nullfunc(object): > def __call__(self, *a, **k): return self > def __getattr(self, name): return getattr(None, name) Could you describe what these functions do? Preferably with examples that demonstrates that they are useful. -- mvh Björn
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4