-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Raymond,
+1 on adding this to the stdlib. I especially like the idea of being able to use an ordered dict in a class's namespace. I might be able use something like that to make my enum package simpler (which currently requires assignment of the name to the integer sort order).
I wanted to point out that the email package uses an ordered dictionary in its Message implementation. Messages present a dictionary-like API for its headers. I don't think I'd be able to use odicts though for this because of other semantic differences, e.g. multiple keys are allowed (though only visible through the non-mapping interface) and KeyError is never raised (like a defaultdict with a __missing__() returning None). Note though that Message's odict-like implementation is about as horribly gross as it can be: it's just a list with linear searching for key lookup. Messages should not have a billion headers. ;)
Have you or Armin considered the possibility of wanting both the defaultdict and odict behavior in, say a mixin subclass?
Barry -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Darwin) iQCVAwUBSawRPXEjvBPtnXfVAQIunwQAlty1Gk3EByWK1fwOaN7+X/eC4QN4YpJL MxWy5l/So3zUM/ofu32kLEjnBLmZOZFp28ExP5QTgse6c0VzNIGP9s6JrZeeAZ7s uYk+EPChLw2GWuFgLQERpHnX9MA3XpCMbv+SheuqBROs31I7L/TCbDISk3+nOjtA LngNgWVlKW4= =glyD -----END PGP SIGNATURE----- _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com