
May 30, 2010
4:54 p.m.
On Sun, 30 May 2010 14:27:05 +0000 (UTC) Benjamin Peterson <benjamin@python.org> wrote:
Antoine Pitrou <solipsis@...> writes:
Perhaps it would be more useful to add a generic collections.keyfuncdict, taking a function which applied to a key
Perhaps; I'm only really interested in the identity version. That could be specified by keyfuncdict(None, None).
Just keyfuncdict(None) or keyfuncdict(id), then. I'm not proposing that the hash() and eq() function be passed, but really a factory function which is used for computing the actual lookup key when doing inserts and lookups (which then implicitly use the natural hash and eq functions for that lookup key, as a normal dict does). Regards Antoine.