> I think the point is that function objects compare by object identity, > so the two lambdas you use above are not equal even though they have the > same code.
it raises an interesting question about why doesn't it. I can think of practical answers to that, obviously, but in principle, if a function compiles to exactly the same byte code, you obviously do not need two copies of it, and like strings shouldn't an identical function have the same id? This is merely philosophical, I don't see the value in making this so (a slight optimizaton and perhaps better conformity to other python features), but I do think it's an interesting question. cheers. -- http://mail.python.org/mailman/listinfo/python-list