On Tue, 08 Oct 2013 22:02:43 +0400, Yuriy Taraday <yorik....@gmail.com> wrote: > There should be a way to avoid creation of the second dict when there is no > need to store original keys. For example, email.message module doesn't > store original headers as they are not needed. The same applies to web > frameworks parsing HTTP headers or WSGI environment.
This is not true. email.message *very carefully* preserves the original header name, case and all [*], that's part of its mandate (faithfully reproducing the original parsed message). That said, email.message can't use transformdict, since email.message needs a list-with-case-insensitive-keyed-lookup, not a dict, because it also preserves the original *order* of the headers. And it couldn't use an orderedtransformdict, either, since it also has to preserve *duplicate* headers. --David [*] currently it loses whitespace information in certain cases, but the new header parser/folder is supposed to fix that...or will once I fix a few more corner cases :) _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com