[Python-Dev] Add a "transformdict" to collections

Ethan Furman ethan at stoneleaf.us
Wed Sep 11 16:34:32 CEST 2013


On 09/11/2013 05:47 AM, Nick Coghlan wrote:
> On 11 September 2013 21:57, R. David Murray <rdmurray at bitdance.com> wrote:
>> Except it is wider than that: the transform function can be anything,
>> not just case folding.
>>
>> I suggested surjectiondict or ontodict, but Antoine didn't like those :)
>> (I had to look up the terms...it's been a long time since I studied
>> math.)
>
> I'll join the chorus requesting that this live on PyPI for a while first.

Personally, I would not add a PyPI dependency for a single object like transformdict.  If we are that nervous about it 
we can make it provisional, but I don't see that as necessary.


> I think this is a case similar to what happened with
> contextlib.ExitStack: I'm not sure if anyone actually *used*
> contextlib2 for anything significant (if they did, they didn't tell me
> about it), but just going through the process of properly documenting,
> publishing and testing it as a relatively independent project forced
> *me* to think through the design.

I had the opposite experience.  Going through PyDev to get Enum was *far* more educational, informative, and useful than 
creating an independent package.  Plus, transformdict is not that new or different from existing dicts, and most 
decisions (which key to keep?  how to initialize?) can be answered by simply being consistent with what we already have.

--
~Ethan~


More information about the Python-Dev mailing list