R. David Murray added the comment:

It would not be sensible for pop to return the default value, since the point 
of pop is to *remove* a key from the dictionary (while returning the existing 
value), whereas the point defaultdict is to *add* key to the dictionary with 
the default value if you retrieve a non-existent key.  As Martin said, an 
important aspect of defaultdict is that *only* getattr has this default 
behavior; things like 'in' still work like a regular dictionary with a 
defaultdict.

----------
nosy: +r.david.murray
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25016>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to