Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #18250

Re: How to get function string name from i-th stack position?

From Lie Ryan <lie.1296@gmail.com>
Subject Re: How to get function string name from i-th stack position?
Date 2011-12-31 22:41 +1100
References <00667d71-b9bc-411d-b2bc-0ead1d1468d7@g41g2000yqa.googlegroups.com> <mailman.4250.1325270163.27778.python-list@python.org> <a9e70268-ee24-4d18-abe2-e994e326be9c@d9g2000yqg.googlegroups.com> <CALwzidnRiFPxubAmnaWeE014djs+ECuvOGHtxXzJdy7CBjSzUw@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.4262.1325331723.27778.python-list@python.org> (permalink)

Show all headers | View raw


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.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

How to get function string name from i-th stack position? dmitrey <dmitrey15@gmail.com> - 2011-12-30 09:51 -0800
  Re: How to get function string name from i-th stack position? Tim Chase <python.list@tim.thechases.com> - 2011-12-30 12:35 -0600
    Re: How to get function string name from i-th stack position? dmitrey <dmitrey15@gmail.com> - 2011-12-30 10:43 -0800
      Re: How to get function string name from i-th stack position? Ian Kelly <ian.g.kelly@gmail.com> - 2011-12-30 14:48 -0700
        Re: How to get function string name from i-th stack position? dmitrey <dmitrey15@gmail.com> - 2011-12-31 00:44 -0800
          Re: How to get function string name from i-th stack position? Ian Kelly <ian.g.kelly@gmail.com> - 2011-12-31 10:13 -0700
      Re: How to get function string name from i-th stack position? Lie Ryan <lie.1296@gmail.com> - 2011-12-31 22:41 +1100
      Re: How to get function string name from i-th stack position? Ian Kelly <ian.g.kelly@gmail.com> - 2011-12-31 10:05 -0700

csiph-web