[Python-Dev] Add a "transformdict" to collections
solipsis at pitrou.net
Wed Sep 11 10:27:32 CEST 2013
Le Tue, 10 Sep 2013 21:40:36 -0500,
Raymond Hettinger <raymond.hettinger at gmail.com> a écrit :
> On Sep 10, 2013, at 4:28 AM, Antoine Pitrou <solipsis at pitrou.net>
> > In http://bugs.python.org/issue18986 I proposed adding a new mapping
> > type to the collections module.
> I would *really* like for this to start outside the standard library.
From a quick search:
- case-insensitive dicts (use cases and implementation attempts):
- identity dicts:
Python's own pickle module:
> It needs to mature with user feedback before being dumped
> in the collections module (which was never intended to be a
> giant pile of every collection a person could think of).
Well, thanks for the reminder, I was *indeed* going to dump all the
collections I could think of in the collections module :-)
(that would have been embarassing!)
Seriously, I'm curious: what needs to mature, according to you? The
proposed collection is a plain MutableMapping with the single addition
of transforming the key on lookup. The use cases are well-defined and
well-known. If you have any concrete questions or concerns then please
offer them here.
> Adding yet more dictionary variants is an example of
So what is your proposal for what is definitely (see examples above,
and this thread's and the tracker's responses) a very common need? Keep
letting people write suboptimal, incomplete, buggy versions of the same
More information about the Python-Dev