'locals' argument of PyEval_EvalCode

Discussion in 'Python' started by Daniel Trstenjak, Nov 28, 2006.

  1. Hi all,

    I would like to know the definition of the 'locals' object given to
    PyEval_EvalCode. Has 'locals' to be a python dictionary or a subtype
    of a python dictionary, or is it enough if the object implements the
    necessary protocols?

    The python implementation behaves different for the two following code
    lines:

    from modul import symbol
    from modul import *

    In the case of the first one, it's enough if the object 'locals' implements
    the necessary protocols. The second one only works if the object 'locals'
    is a type or subtype of dictionary.


    Best Regards,
    Daniel
     
    Daniel Trstenjak, Nov 28, 2006
    #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. Aaron Ackerman
    Replies:
    5
    Views:
    423
    Chris Dunaway
    Oct 13, 2003
  2. dgk
    Replies:
    2
    Views:
    413
  3. Giles Brown

    Question about "exec in globals, locals"

    Giles Brown, Jul 4, 2003, in forum: Python
    Replies:
    2
    Views:
    370
    Adrien Di Mascio
    Jul 4, 2003
  4. Replies:
    9
    Views:
    729
    Gabriel Genellina
    Nov 14, 2007
  5. Replies:
    3
    Views:
    965
    Gabriel Genellina
    Mar 11, 2009
Loading...

Share This Page