Barry Warsaw <[EMAIL PROTECTED]> writes:

> However, .setdefault() is a horrible name because it's not clear
> from the name that a 'get' operation also happens.

Agreed!  From the name, a clever but naive user would assume that
"setdefault" sets what value the dictionary returns when a key does
not exist.  On first encountering the name, one imagines:

>>> d = {}
>>> d[1]
KeyError: 1
>>> d.setdefault('missing')
>>> d[1]
'missing'

-- 
Brandon Craig Rhodes   [EMAIL PROTECTED]   http://rhodesmill.org/brandon
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to