[Python-Dev] Proposal: defaultdict (original) (raw)
"Martin v. Löwis" martin at v.loewis.de
Fri Feb 17 08:09:23 CET 2006
- Previous message: [Python-Dev] Proposal: defaultdict
- Next message: [Python-Dev] Proposal: defaultdict
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Guido van Rossum wrote:
Feedback?
I would like this to be part of the standard dictionary type, rather than being a subtype.
d.setdefault([]) (one argument) should install a default value, and d.cleardefault() should remove that setting; d.default should be read-only. Alternatively, d.default could be assignable and del-able.
Also, I think has_key/in should return True if there is a default.
Regards, Martin
- Previous message: [Python-Dev] Proposal: defaultdict
- Next message: [Python-Dev] Proposal: defaultdict
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]