Re: [Python-Dev] functools additions

2007-04-15 Thread Jean-Paul Calderone
On Sun, 15 Apr 2007 18:18:16 -0400, SevenInchBread <[EMAIL PROTECTED]> wrote: >>>Do you have commit access? What's your real name? >I prefer to remain pseudonymous, and I don't have commit access. > >Yeah... they're not terribly useful - more or less there for the sake of >being there. Batteries in

Re: [Python-Dev] functools additions

2007-04-15 Thread BJörn Lindqvist
> 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: fi

Re: [Python-Dev] functools additions

2007-04-15 Thread SevenInchBread
Do you have commit access? What's your real name? I prefer to remain pseudonymous, and I don't have commit access. Yeah... they're not terribly useful - more or less there for the sake of being there. Batteries included and all that ...but now I've got a more useful idea for a function wrapper

Re: [Python-Dev] functools additions

2007-04-15 Thread Martin v. Löwis
> So if it's alright with the privledged folk - I'd like to commit > these minor (and probably non-controversial) additions to the functools > module. Do you have commit access? What's your real name? -1 on these additions. If lambda x:x would be added, it should be named "identity", not "cat

[Python-Dev] functools additions

2007-04-15 Thread SevenInchBread
So if it's alright with the privledged folk - I'd like to commit these minor (and probably non-controversial) additions to the functools module. 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