[Python-Dev] Proposal: defaultdict (original) (raw)
skip at pobox.com skip at pobox.com
Fri Feb 17 19:20:54 CET 2006
- Previous message: [Python-Dev] Proposal: defaultdict
- Next message: [Python-Dev] Proposal: defaultdict
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
>> 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
- Previous message: [Python-Dev] Proposal: defaultdict
- Next message: [Python-Dev] Proposal: defaultdict
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]