Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #93171 > unrolled thread

Re: converting boolean filter function to lambda

Started byEthan Furman <ethan@stoneleaf.us>
First post2015-06-25 17:57 -0700
Last post2015-06-25 17:57 -0700
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: converting boolean filter function to lambda Ethan Furman <ethan@stoneleaf.us> - 2015-06-25 17:57 -0700

#93171 — Re: converting boolean filter function to lambda

FromEthan Furman <ethan@stoneleaf.us>
Date2015-06-25 17:57 -0700
SubjectRe: converting boolean filter function to lambda
Message-ID<mailman.88.1435280263.3674.python-list@python.org>
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~

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web