Hi, [EMAIL PROTECTED] wrote:
Pekka Laukkanen:
...
On the other hand it has some little practical advantages, you can do: sum(x == y for x in iterable)That also equals to a more tidy: sum(1 for x in iterable if x == y)
Wouldn't len([x for x in iterable if x==y]) or even shorter: iterable.count(y) not work and read better anyway? even calculating with boolean values isn't neccessary since 'and' and 'foo if bar else blub' are working much better so the type coalescing bool - int - float can really go away. Tino
smime.p7s
Description: S/MIME Cryptographic Signature
-- http://mail.python.org/mailman/listinfo/python-list