Re: Rép : Why is str(None) == 'None' and not an empty string?

2013-08-29 Thread fp2161
On Thursday, August 29, 2013 12:55:36 PM UTC+2, Ian wrote: > On Wed, Aug 28, 2013 at 5:42 AM, Fabrice POMBET wrote: > > > > > > On 8/28/2013 4:57 AM, Piotr Dobrogost wrote: > > > > > >> Having repr(None) == 'None' is sure the right thing but why does str(None) > >> == 'None'? Wouldn't it be m

Re: Is there a function that applies list of functions to a value?

2013-08-29 Thread fp2161
On Wednesday, August 28, 2013 2:52:46 PM UTC+2, AdamKal wrote: > Hi, > > > > From time to time I have to apply a series of functions to a value in such a > way: > > > > func4(func3(func2(func1(myval > > > > I was wondering if there is a function in standard library that would take a

Re: Is there a function that applies list of functions to a value?

2013-08-29 Thread fp2161
On Thursday, August 29, 2013 11:05:38 PM UTC+2, Chris Angelico wrote: > On Fri, Aug 30, 2013 at 6:50 AM, wrote: > > > My way is so obvious that it may not be that interesting... > > > > > > def func4(f1,f2,f3,f4): > > > def anon(x): > > > f1(f2(f3(f4(x > > > return anon

Re: Is there a function that applies list of functions to a value?

2013-08-29 Thread fp2161
On Thursday, August 29, 2013 11:05:38 PM UTC+2, Chris Angelico wrote: > On Fri, Aug 30, 2013 at 6:50 AM, wrote: > > > My way is so obvious that it may not be that interesting... > > > > > > def func4(f1,f2,f3,f4): > > > def anon(x): > > > f1(f2(f3(f4(x > > > return anon

Re: Is there a function that applies list of functions to a value?

2013-08-29 Thread fp2161
On Wednesday, August 28, 2013 3:10:49 PM UTC+2, Jussi Piitulainen wrote: > AdamKal writes: > > > > > Hi, > > > > > > From time to time I have to apply a series of functions to a value > > > in such a way: > > > > > > func4(func3(func2(func1(myval > > > > > > I was wondering if the

Re: Is there a function that applies list of functions to a value?

2013-08-29 Thread fp2161
On Friday, August 30, 2013 4:09:45 AM UTC+2, Steven D'Aprano wrote: > On Thu, 29 Aug 2013 13:50:39 -0700, fp2161 wrote: > > > > > My way is so obvious that it may not be that interesting... > > > > > > def func4(f1,f2,f3,f4): > >

Re: Is there a function that applies list of functions to a value?

2013-08-29 Thread fp2161
On Thursday, August 29, 2013 11:35:39 PM UTC+2, Chris Angelico wrote: > On Fri, Aug 30, 2013 at 7:27 AM, wrote: > > > Chris, call me a snob, but I resent using lambdas (aren't they usually > > considered odd/bad practice in python?) > > > > They're not bad practice; all they are is a functio

Re: Is there a function that applies list of functions to a value?

2013-08-29 Thread fp2161
On Wednesday, August 28, 2013 8:50:53 PM UTC+2, Josh English wrote: > Reduce tricks are nice, but I prefer clarity sometimes: > > > > def double(x): > > return x*2 > > > > def add3(x): > > return x+3 > > > > > > def compose(*funcs): > > for func in funcs: > > if n