Variable lookup in calling context

Discussion in 'Python' started by Stefan Franke, Sep 16, 2003.

  1. To access a calling function's locals I can use sys._getframe(1).f_locals.
    But how do I perform a full variable lookup in the context of the caller
    as if it happened there - including all surrounding scopes?

    (BTW: Is inspect.currentframe preferable over sys._getframe?)

    Stefan
    Stefan Franke, Sep 16, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. VS_NET_DEV
    Replies:
    2
    Views:
    3,786
    jenny
    May 25, 2004
  2. =?Utf-8?B?U3VuU21pbGU=?=
    Replies:
    0
    Views:
    687
    =?Utf-8?B?U3VuU21pbGU=?=
    Jan 10, 2006
  3. Replies:
    2
    Views:
    1,223
  4. Demetz Markus

    Context.lookup

    Demetz Markus, Nov 26, 2005, in forum: Java
    Replies:
    2
    Views:
    11,623
    Frank Langelage
    Nov 27, 2005
  5. Flip Rayner
    Replies:
    1
    Views:
    636
    bruce barker
    Jan 23, 2007
Loading...

Share This Page