Pre-PEP: Dictionary accumulator methods

Pierre Barbier de Reuille pierre.barbier at cirad.fr
Sat Mar 19 14:04:40 CET 2005


Ivan Van Laningham a écrit :
> 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.
 >
> [...]
> 
> There is no existing add() method for dictionaries.  Given the name
> change, I'd like to see it.
> 
> Metta,
> Ivan

I don't think "add" is a good name ... even if it doesn't exist in 
dictionnarie, it exists in sets and, IMHO, this would add confusion ...

Pierre


> ----------------------------------------------
> Ivan Van Laningham
> God N Locomotive Works
> http://www.pauahtun.org/
> http://www.andi-holmes.com/
> Army Signal Corps:  Cu Chi, Class of '70
> Author:  Teach Yourself Python in 24 Hours



More information about the Python-list mailing list