On Wednesday 2006-07-26 07:20, Greg Ewing wrote: > Andrew Koenig wrote: > > I think of a > > function f as being idempotent if f(x) == x for all x in dom(f). > > Um, that's an identity function, isn't it? I think > you mean something more like f(f(x)) == f(x). > > But even that's not quite what we're talking about > here, because we're not hashing the result of the > hash function. If idempotency is involved it's > about side effects rather than the return value. > From a functional point of view, the hash value > of a given object should simply be constant.
What needs to be idempotent -- i.e., to satisfy f(f(x))==f(x) -- is the function (from states of the world to states of the world, suitably abstracted) that describes the total effect of calling the hash function. -- g _______________________________________________ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com
