TransformDict (PEP 455) Naming
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. Name for the PEP 455 should be less abstract, more specialized. Which transform? What is transformed? Where the transformation is taking place? How it is going to be used? Why do you need a generalized structure? In PEP 455 I see two use cases only. 1. Case-insensitive keys. dictik() - dictionary with insensitive keys 2. Identity dict. dictik() - dictionary with implicit keys The generic name for collections entry can be VagueKeysDict() or DynamicKeysDict() or DynKeyDict(). The name should tell what's going on with the type to people completely unfamiliar with concept. OrderedDict() is a good name - dict with ordered entries, NamedTuple() is so-so - tuple that has a name, but also ok. TransformDict() is just too generic and doesn't tell anything - something is transformed, or dict somehow transformed, or dict for transform. There should be a better name. -- anatoly t.
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.
participants (2)
-
anatoly techtonik
-
Glenn Linderman