> 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 _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com