On 6 16 , 12 33 , Carsten Haese <[EMAIL PROTECTED]> wrote: > On Fri, 2007-06-15 at 14:15 +0000, Ping wrote: > > using sum(1 ...) to mean count() isn't very intuitive > > I find it very intuitive, but then again, my years of studying Math may > have skewed my intuition. > > > I would still prefer an expression like a_list.count(a_callable), > > which is short, clean, and easy to understand. > > Did you see my alternative example on this thread? It allows you to use > list.count in almost exactly that way, except that instead of passing > the callable directly, you pass an object that defers to your callable > in its __eq__ method. > > HTH, > > -- > Carsten Haesehttp://informixdb.sourceforge.net
Yes, I read it. This works, but it may make lots of dummy classes with the special __eq__ method if I have many criteria to use for counting. I find the function design mentioned by Dustan most attractive. :) cheers, Ping -- http://mail.python.org/mailman/listinfo/python-list