[Python-Dev] Proposal: defaultdict (original) (raw)
"Martin v. Löwis" martin at v.loewis.de
Fri Feb 17 23:00:36 CET 2006
- Previous message: [Python-Dev] Proposal: defaultdict
- Next message: [Python-Dev] Proposal: defaultdict
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Fuzzyman wrote:
Also, I think haskey/in should return True if there is a default.
And exactly what use would it then be ?
Code that checks
if d.has_key(k): print d[k]
would work correctly. IOW, you could use a dictionary with a default key just as if it were a normal dictionary - which is a useful property, IMO.
Regards, Martin
- Previous message: [Python-Dev] Proposal: defaultdict
- Next message: [Python-Dev] Proposal: defaultdict
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]