Tino Wildenhain:

> Wouldn't
> len([x for x in iterable if x==y])
> or even shorter:
> iterable.count(y)
> not work and read better anyway?

The first version creates an actual list just to take its length,
think about how much memory it may use.
The second version requires the 'iterable' object to have a count()
method, and in general this is false.


> 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.

I don't understand.

Bye,
bearophile
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to