Setdefault bypasses __setitem__

Fredrik Lundh fredrik at pythonware.com
Thu Oct 13 13:17:33 CEST 2005


Peter Otten wrote:

> Are we talking about the same setdefault()?
>
> setdefault(...)
>    D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D

note that it might be spelled "setdefault", but it should be pronounced
"get or set".

</F> 






More information about the Python-list mailing list