[Python-Dev] Proposal: defaultdict (original) (raw)

skip at pobox.com skip at pobox.com
Fri Feb 17 19:20:54 CET 2006


>> Also, I think has_key/in should return True if there is a default.

Fredrik> and keys should return all possible key values!

I think keys() and in should reflect reality. Only when you do something like

x = d['nonexistent']

or

x = d.get('nonexistent')

should the default value come into play.

Skip



More information about the Python-Dev mailing list