Pre-PEP: Dictionary accumulator methods

Ivan Van Laningham ivanlan at pauahtun.org
Sat Mar 19 09:18:11 EST 2005


Hi All--

Raymond Hettinger wrote:
> 
> [Michele Simionato]
> > +1 for inc instead of count.
> 
> Any takers for tally()?
> 

Sure.  Given the reasons for avoiding add(), tally()'s a much better
choice than count().

What about d.tally(key,0) then?  Deleting the key as was suggested by
Michael Spencer seems non-intuitive to me.

> > Just my 2 Eurocents,
> 
> I raise you by a ruble and a pound ;-)
> 

<hardly-anything-is-worth-less-than-vietnamese-dong>-ly y'rs,
Ivan
----------------------------------------------
Ivan Van Laningham
God N Locomotive Works
http://www.andi-holmes.com/
http://www.foretec.com/python/workshops/1998-11/proceedings.html
Army Signal Corps:  Cu Chi, Class of '70
Author:  Teach Yourself Python in 24 Hours



More information about the Python-list mailing list