[Python-Dev] PEP 455: TransformDict
g.brandl at gmx.net
Sat Sep 14 07:24:27 CEST 2013
On 09/13/2013 10:09 PM, R. David Murray wrote:
> On Fri, 13 Sep 2013 20:40:58 +0200, Antoine Pitrou <solipsis at pitrou.net> wrote:
>> Numerous specialized versions of this pattern exist. The most common
>> is a case-insensitive case-preserving dict, i.e. a dict-like container
>> which matches keys in a case-insensitive fashion but retains the
>> original casing. It is a very common need in network programming, as
>> many protocols feature some arrays of "key / value" properties in their
>> messages, where the keys are textual strings whose casing isn't
> This motivation would be stronger if the last phrase was something like
> "where the keys are textual strings whose case is specified to be ignored
> on receipt but by either specification or custom is to be preserved
> or non-trivially canonicalized when retransmitted."
>> (it can be said that the pattern *projects* keys from the user-visible
>> set onto the internal lookup set, hence this PEP's title)
> Not clear what "projects" has to do with the PEP title.
Clearly it should be called ProjectionDict!
More information about the Python-Dev