Pre-PEP: Dictionary accumulator methods

Mike Rovner mrovner at propel.com
Sat Mar 19 03:04:28 CET 2005


Ivan Van Laningham wrote:
> Hi All--
> Maybe I'm not getting it, but I'd think a better name for count would be
> add.  As in
> 
> d.add(key)
> d.add(key,-1)
> d.add(key,399)
> etc.

IMHO inc (for increment) is better.

d.inc(key)

add can be read as add key to d

Mike




More information about the Python-list mailing list