On Apr 27, 1:10 pm, Terry Reedy wrote:
> The difference between
>
> hasvowels = lambda x:max([y in x for y in "aeiou"])
>
> and
>
> def hasvowels(x): return max([y in x for y in "aeiou"])
>
> is that the first is 4 chars shorter, but the result has a generic
> .__name__ attribute of '' insteand of
On Apr 25, 12:11 pm, Duncan Booth
wrote:
> jazbees wrote:
> >>>> hasvowels = lambda x:max([y in x for y in "aeiou"])
> >>>> hasvowels("parsnips")
> > True
> >>>> hasvowels("sfwdkj")
> > False
>
>
I'm surprised to see that the use of min and max for element-wise
comparison with lists has not been mentioned. When fed lists of True/
False values, max will return True if there is at least one True in
the list, while min will return False if there is at least one False.
Going back to the OP's i
Apologies if this is too regional and not of interest to the broader
Python community, but I felt I should pass along the link to an event
I stumbled across today:
http://2008.utosc.com/pages/home/
Some talks on the schedule are either directly about Python ("Vim and
Python", "Using Lasers, Webca