dict.setdefault() (Patch#101102) (was: Re: [Python-Dev] Re: A small proposed change to dictionaries' "get" method...)

Peter Funk pf@artcom-gmbh.de
Tue, 8 Aug 2000 10:00:29 +0200 (MEST)


Hi Tim!

Tim Peters:
[...]
> Ha!  I *told* Guido people would think that's the proper use of something
> named setdefault <0.9 wink>.
[...]
>     dict.getorset('hi', []).append(42)  # getorset is my favorite

'getorset' is a *MUCH* better name compared to 'default' or 'setdefault'. 

Regards, Peter