[EMAIL PROTECTED] wrote in news:240454f2-14ee-496a-9078-1abbf80a4e64 @m45g2000hsb.googlegroups.com:
> castironpi: >> For max and min, why can't you just add your argument to the set >> itself? > > Sometimes that can be done, but in many other situations it's less > easy, like in the example I have shown in my first post: > > max((fun(x) for x in iterable if predicate(x))) > > There are some ways to add the max there, for example using an > itertools.chain to chan the default value to the end of the iterable, > but most of the time I just write a for loop. Is there any problem with: max(initial_value, *(fun(x) for x in iterable if predicate(x) ) ) ? -- http://mail.python.org/mailman/listinfo/python-list