[Python-Dev] TransformDict (PEP 455) Naming

Glenn Linderman v+python at g.nevcal.com
Mon Sep 16 17:31:58 CEST 2013


On 9/15/2013 11:28 PM, anatoly techtonik wrote:
> Does anybody know if http://vote.python.org is already operational?
>
> I decided to start a separate thread for TransformDict name, because I
> want to change it.
> Current implementation of PEP 455 only touches dictionary keys and it
> is more narrow than the name suggests. I'd reserve TransformDict name
> for something that is used to transform some other data. For my data
> transformation theory I have an idea of mapping with annotated fields
> that is used to change the names of some source data structure to
> target data structure, converting types and applying custom rules on
> the way. This is a different, but more intuitive application of such
> name.

The multitude of data transformations that are possible are certainly 
broader than the scope of TransformDict. However, such transformations 
have little to do with the operation of a dict ... the key 
characteristic of a dict is accessing data by key value, and the idea of 
transformation for a dict is easily understood to be a transformation of 
that access pattern, rather than a rich transformation of the data.

Rich data transformations may be useful, and if possible to abstract a 
large number of useful data transformations into an API that would 
become popular, it would seem that such transformations would want to be 
applied not only to dict, but also to list and other data structures. It 
would be more of an object-to-object mapping, independent of the 
container that might hold the object during part of its lifetime.

Hence, it seems unlikely to me that "dict" would be part of the name or 
requirements for such rich data transformations, leaving TransformDict 
available to be used for exactly what PEP 455 proposes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20130916/2e316906/attachment.html>


More information about the Python-Dev mailing list