Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #93174
| From | Mark Lawrence <breamoreboy@yahoo.co.uk> |
|---|---|
| Subject | Re: converting boolean filter function to lambda |
| Date | 2015-06-26 02:08 +0100 |
| References | <558C256D.7080903@stoneleaf.us> <CAPTjJmpuwkapSOWKXVJUEscNwVjB+qnr9WZ6AwJjjjA0KY54sQ@mail.gmail.com> <mmi57h$tjv$1@ger.gmane.org> <558CA373.2000409@stoneleaf.us> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.90.1435280934.3674.python-list@python.org> (permalink) |
On 26/06/2015 01:57, Ethan Furman wrote: > On 06/25/2015 05:09 PM, Mark Lawrence wrote: >> On 26/06/2015 00:59, Chris Angelico wrote: >>> On Fri, Jun 26, 2015 at 1:59 AM, Ethan Furman <ethan@stoneleaf.us> >>> wrote: >>>> My attempt at a lambda function fails: >>>> >>>> filter(lambda p: (p in c for c in contacts), main) >>>> # ['291.792.9001', '291.792.9000'] >>>> >>>> Besides using a lambda ;) , what have I done wrong? >>> >>> This looks like a job for a list comprehension! >>> >>> (Cue the swooping-in cape-wearing list comp, coming to save the day) >>> >>> ChrisA >>> >> >> In exactly the same way that swooping-in cape-wearing Greg Ewing, from >> the home of 10 man rugby, had to point out to Ethan some years back >> what "booted into touch" meant? :) >> >> I've also seen Ethan refer to bowlers today, I just hope he's very >> careful and doesn't get caught on the back foot. Next question from >> Ethan is? > > Uh, "caught on the back foot"? I thought I was okay as long as I didn't > slide across the line or gutter the ball. ;) > > -- > ~Ethan~ I takes it you're referring to the cissies game where everybody has to wear a glove just to catch the ball? And there's no seam to cut your hands if you get it wrong, so I guess they don't bother rubbing white spirit into the hands to help toughen them up? :) -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: converting boolean filter function to lambda Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-06-26 02:08 +0100
csiph-web