Re: Filter versus comprehension (was Re: something about split()???)

2012-08-25 Thread Tim Golden
On 25/08/2012 13:57, David Robinow wrote: On Fri, Aug 24, 2012 at 3:03 PM, Walter Hurry wrote: On Fri, 24 Aug 2012 14:29:00 -0400, Dennis Lee Bieber wrote: It appears to be a change Google made in the last month or two... My hypothesis is that they are replacing hard EOL found in inbound NNTP

Re: Filter versus comprehension (was Re: something about split()???)

2012-08-25 Thread David Robinow
On Fri, Aug 24, 2012 at 3:03 PM, Walter Hurry wrote: > On Fri, 24 Aug 2012 14:29:00 -0400, Dennis Lee Bieber wrote: > >> It appears to be a change Google made in the last month or two... My >> hypothesis is that they are replacing hard EOL found in inbound NNTP >> with an HTML , and then on outgoi

Re: Filter versus comprehension (was Re: something about split()???)

2012-08-24 Thread Walter Hurry
On Fri, 24 Aug 2012 17:56:47 -0400, Dennis Lee Bieber wrote: > On Fri, 24 Aug 2012 19:03:51 + (UTC), Walter Hurry > declaimed the following in > gmane.comp.python.general: > > >> Google Groups sucks. These are computer literate people here. Why don't >> they just use a proper newsreader? >

Re: Filter versus comprehension (was Re: something about split()???)

2012-08-24 Thread Ned Deily
In article , Mark Lawrence wrote: > I don't think the core-mentorship list is available on gmane. Have I > missed it, has nobody asked for it to go on there or what? core-mentorship is a closed list so it would not be appropriate for it to be mirrored anywhere. http://mail.python.org/mailman

Re: Filter versus comprehension (was Re: something about split()???)

2012-08-24 Thread Ned Deily
In article , Emile van Sebille wrote: > On 8/24/2012 3:03 PM Terry Reedy said... > > Python lists are available on the free gmane mail-to-news server. > I'm getting high load related denials with the gmane connections a lot > recently so I'm open to alternatives. The high load denials should be

Re: Filter versus comprehension (was Re: something about split()???)

2012-08-24 Thread Mark Lawrence
On 24/08/2012 23:03, Terry Reedy wrote: On 8/24/2012 5:56 PM, Dennis Lee Bieber wrote: On Fri, 24 Aug 2012 19:03:51 + (UTC), Walter Hurry declaimed the following in gmane.comp.python.general: Google Groups sucks. These are computer literate people here. Why don't they just use a proper n

Re: Filter versus comprehension (was Re: something about split()???)

2012-08-24 Thread Emile van Sebille
On 8/24/2012 3:03 PM Terry Reedy said... On 8/24/2012 5:56 PM, Dennis Lee Bieber wrote: On Fri, 24 Aug 2012 19:03:51 + (UTC), Walter Hurry declaimed the following in gmane.comp.python.general: Google Groups sucks. These are computer literate people here. Why don't they just use a proper

Re: Filter versus comprehension (was Re: something about split()???)

2012-08-24 Thread Terry Reedy
On 8/24/2012 5:56 PM, Dennis Lee Bieber wrote: On Fri, 24 Aug 2012 19:03:51 + (UTC), Walter Hurry declaimed the following in gmane.comp.python.general: Google Groups sucks. These are computer literate people here. Why don't they just use a proper newsreader? Probably because the

Re: Filter versus comprehension (was Re: something about split()???)

2012-08-24 Thread Walter Hurry
On Fri, 24 Aug 2012 14:29:00 -0400, Dennis Lee Bieber wrote: > It appears to be a change Google made in the last month or two... My > hypothesis is that they are replacing hard EOL found in inbound NNTP > with an HTML , and then on outgoing replacing the with a pair of > NNTP line endings. In con

Re: Filter versus comprehension (was Re: something about split()???)

2012-08-24 Thread Terry Reedy
On 8/24/2012 10:44 AM, Ramchandra Apte wrote: On Wednesday, 22 August 2012 22:13:04 UTC+5:30, Terry Reedy wrote: >>> timeit.timeit("list(i for i in ranger if False)", "ranger=range(0)") >> 0.91 >>> timeit.timeit("list(i for i in ranger if False)", "ranger=range(20)") 1.28 >>> timei

Re: something about split()???

2012-08-24 Thread Laszlo Nagy
On 2012-08-15 07:33, Ramchandra Apte wrote: filter is bad when you use lambda with it there are (good) cases for filter On 14 August 2012 22:39, Jean-Michel Pichavant > wrote: Ramchandra Apte wrote: (Much) more Pythonic solution: >>> filter(N

Re: Filter versus comprehension (was Re: something about split()???)

2012-08-24 Thread Ramchandra Apte
On Wednesday, 22 August 2012 22:13:04 UTC+5:30, Terry Reedy wrote: > On 8/22/2012 3:30 AM, Mark Lawrence wrote: > > > On 22/08/2012 06:46, Terry Reedy wrote: > > >> On 8/21/2012 11:43 PM, mingqiang hu wrote: > > >>> why filter is bad when use lambda ? > > >> > > >> Inefficient, not 'bad'. Bec

Filter versus comprehension (was Re: something about split()???)

2012-08-22 Thread Terry Reedy
On 8/22/2012 3:30 AM, Mark Lawrence wrote: On 22/08/2012 06:46, Terry Reedy wrote: On 8/21/2012 11:43 PM, mingqiang hu wrote: why filter is bad when use lambda ? Inefficient, not 'bad'. Because the equivalent comprehension or generator expression does not require a function call. for each i

Re: something about split()???

2012-08-22 Thread Mark Lawrence
On 22/08/2012 06:46, Terry Reedy wrote: On 8/21/2012 11:43 PM, mingqiang hu wrote: why filter is bad when use lambda ? Inefficient, not 'bad'. Because the equivalent comprehension or generator expression does not require a function call. A case of premature optimisation? :) -- Cheers. Mar

Re: something about split()???

2012-08-21 Thread Terry Reedy
On 8/21/2012 11:43 PM, mingqiang hu wrote: why filter is bad when use lambda ? Inefficient, not 'bad'. Because the equivalent comprehension or generator expression does not require a function call. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: something about split()???

2012-08-21 Thread mingqiang hu
why filter is bad when use lambda ?actually I think I can use lambda like this: filter(lambda x:x==None,"|",split("|")) On Wed, Aug 15, 2012 at 1:33 PM, Ramchandra Apte wrote: > filter is bad when you use lambda with it > there are (good) cases for filter > > > On 14 August 2012 22:39, Jean-Miche

Re: something about split()???

2012-08-15 Thread Mark Lawrence
On 14/08/2012 18:09, Jean-Michel Pichavant wrote: Ramchandra Apte wrote: A pythonic answer would be bottom-posted :p JM He or she is still top posting. I'm given up asking. -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: something about split()???

2012-08-14 Thread Ramchandra Apte
filter is bad when you use lambda with it there are (good) cases for filter On 14 August 2012 22:39, Jean-Michel Pichavant wrote: > Ramchandra Apte wrote: > >> (Much) more Pythonic solution: >> >>> filter(None,"|".split("|")) >> >> On 14 August 2012 15:14, Andreas Tawn > andreas.tawn@ubisoft.**co

Re: something about split()???

2012-08-14 Thread Jean-Michel Pichavant
Ramchandra Apte wrote: (Much) more Pythonic solution: >>> filter(None,"|".split("|")) On 14 August 2012 15:14, Andreas Tawn > wrote: > I have a question about the split function? surpose a = "|",and when I use a.split("|") , I got the list > ['"",""

Re: something about split()???

2012-08-14 Thread Ramchandra Apte
(Much) more Pythonic solution: >>> filter(None,"|".split("|")) On 14 August 2012 15:14, Andreas Tawn wrote: > > I have a question about the split function? surpose a = "|",and when I > use a.split("|") , I got the list > > ['"",""] ,but I want to get the empty list,what should I do ? > > Somethi

RE: something about split()???

2012-08-14 Thread Andreas Tawn
> I have a question about the split function? surpose a = "|",and when I use > a.split("|") , I got the list > ['"",""] ,but I want to get the empty list,what should I do ? Something like... >>> [x for x in "|".split("|") if x] [] Cheers, Drea -- http://mail.python.org/mailman/listinfo/python