[Python-Dev] setdefault's second argument

Fredrik Lundh fredrik at pythonware.com
Tue Aug 30 22:46:45 CEST 2005

Tim Peters wrote:

>> Anyone remember why nobody managed to come up with a better name
>> for setdefault (which is probably the worst name ever given to a method
>> in the standard Python distribution) ?
> I suggested a perfect name at the time:
>    http://mail.python.org/pipermail/python-dev/2000-August/008036.html
> To save you from following that link, to this day I still mentally
> translate "setdefault" to "getorset" whenever I see it.

from this day, I'll do that as well.

I have to admit that I had to follow that link anyway, just to make sure
I wasn't involved in the decision at that time (which I wasn't, from what
I can tell).

But I stumbled upon this little naming protocol

    Protocol: if you have a suggestion for a name for this function, mail
    it to me.  DON'T MAIL THE LIST.  (If you mail it to the list, that
    name is disqualified.)  Don't explain me why the name is good -- if
    it's good, I'll know, if it needs an explanation, it's not good.

which I thought was most excellent, and something that we might PEP:ify
for future use, until I realized that it gave us the "worst name ever"... 


More information about the Python-Dev mailing list