Re: [Python-Dev] PEP 455: TransformDict

2013年9月13日 22:26:55 -0700

On 09/13/2013 10:09 PM, R. David Murray wrote:
> On 2013年9月13日 20:40:58 +0200, Antoine Pitrou <[email protected]> 
> wrote:
>> Rationale
>> =========
>> 
>> 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
>> relevant.
> 
> 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!
cheers,
Georg
_______________________________________________
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to