[Bill Janssen]
> Yeah, but you can't do more complicated expressions that way, like
>
> any(lambda x: x[3] == "thiskey")
You're not making any sense. The sequence argument is not listed and the
lambda
is unnecessary. Try this instead:
any(x[3] == 'thiskey' for x in seq)
> I think it makes a lot of sense for any and all to take optional
> predicate function arguments.
I think you don't understand what you already have to work with in Py2.5a -- a
boolean expression in a genexp should always suffice -- no separate lambda
based
predicate function is ever required.
Raymond
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com