This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eric.snow
Recipients benjamin.peterson, cvrebert, daniel.urban, eric.snow, meador.inge, ncoghlan
Date 2011-12-28.06:30:46
SpamBayes Score 2.1803115e-12
Marked as misclassified No
Message-id <1325053848.06.0.508640528539.issue12857@psf.upfronthosting.co.za>
In-reply-to
Content
My response to a similar query:

What it enables is the ability to introspect the *actual* function object belonging to the currently executing code, whether in the same execution frame or in a later one on the stack.  We don't have that now.  The best we can do is guess, and I'm trying to refuse the temptation by building in an alternative that doesn't get in the way (and doesn't provide an attractive nuisance).

My motivation for this patch was to be able to find out, in one of my functions, what function called it and to interact with that function object.  The name or file represented in the code object on the stack didn't cut it; and decorators and function factories make the whole thing a mess.  Guido sounded rather positive to the idea, which is why I pursued it.  From Guido's post to which I linked in the issue[1]:

   > For me the use case involves determining what function called my
   > function.  Currently you can tell in which execution frame a function
   > was called, and thereby which code object, but reliably matching that
   > to a function is not so simple.  I recognize that my case is likely
   > not a general one.

   But it is a nice one. It solves some issues that pdb currently solves
   by just using a file/line reference.

Not that it necessarily matters, but I could dig up the bit of code that motivated the whole thing.  I recall it was something related to writing an enum library (a la flufl.enum).  Anyway, I'd love to see this move forward.


[1] http://mail.python.org/pipermail/python-ideas/2011-August/011062.html
History
Date User Action Args
2011-12-28 06:30:48eric.snowsetrecipients: + eric.snow, ncoghlan, benjamin.peterson, cvrebert, meador.inge, daniel.urban
2011-12-28 06:30:48eric.snowsetmessageid: <1325053848.06.0.508640528539.issue12857@psf.upfronthosting.co.za>
2011-12-28 06:30:47eric.snowlinkissue12857 messages
2011-12-28 06:30:46eric.snowcreate