On 12/31/2011 08:48 AM, Ian Kelly wrote:

But they are two distinct function objects, and there is no way
programmatically to determine that they are the same function except
by comparing the bytecode (which won't work generally because of the
halting problem).

Actually, it is often possible to determine that two functions are the same function, you simply need a to compare whether the function object lives in the same memory address. It is also possible to determine if two functions are different, if the function object are in different memory address than the function is different function.

What is difficult to do due to the Halting problem is comparing whether two different functions are "equivalent" (and therefore interchangeable).

I think the OP wants to find the former, not the latter. The former is trivial, the latter impossible.

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to