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?

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news-out2.kabelfoon.nl!newsfeed.kabelfoon.nl!xindi.nntp.kabelfoon.nl!feed.xsnews.nl!border-1.ams.xsnews.nl!xlned.com!feeder7.xlned.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'distinct': 0.05; 'subject:position': 0.05; 'function,': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'subject:string': 0.09; 'am,': 0.12; 'bytecode': 0.16; 'different,': 0.16; 'problem).': 0.16; 'subject:function': 0.16; 'wrote:': 0.18; '(which': 0.19; 'memory': 0.21; 'header:In-Reply-To:1': 0.22; 'objects,': 0.23; 'function': 0.27; 'compare': 0.28; '(and': 0.28; 'problem': 0.29; 'generally': 0.30; 'kelly': 0.30; 'subject:?': 0.31; "won't": 0.33; 'header:User-Agent:1': 0.33; 'header:X-Complaints-To:1': 0.33; 'there': 0.33; 'object': 0.33; 'to:addr:python-list': 0.34; 'function.': 0.34; 'latter': 0.34; 'subject:How': 0.35; 'received:au': 0.36; 'comparing': 0.37; 'two': 0.37; 'but': 0.37; 'except': 0.37; 'think': 0.37; 'received:org': 0.38; 'subject:from': 0.38; 'difficult': 0.39; 'to:addr:python.org': 0.40; 'address': 0.61; 'lives': 0.63; 'due': 0.66; 'subject:name': 0.67; '08:48': 0.84; 'received:110': 0.95
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Lie Ryan <lie.1296@gmail.com>
Subject Re: How to get function string name from i-th stack position?
Date Sat, 31 Dec 2011 22:41:46 +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>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host 110-175-240-90.static.tpgi.com.au
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111124 Thunderbird/8.0
In-Reply-To <CALwzidnRiFPxubAmnaWeE014djs+ECuvOGHtxXzJdy7CBjSzUw@mail.gmail.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.4262.1325331723.27778.python-list@python.org> (permalink)
Lines 19
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1325331723 news.xs4all.nl 6958 [2001:888:2000:d::a6]:47174
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:18250

Show key headers only | 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