On Wed, Nov 26, 2014 at 9:22 PM, Kasper Peeters <kas...@phi-sci.com> wrote:
> That is, I want
> to do:
>
>   def fun():
>      q=3
>      def fun2():
>         cfun()
>      fun2()
>
>   fun()
>
> and access 'q' inside the C-function cfun(). If I simply let it call
> PyEval_GetLocals, then the result will again not contain "q". Is there
> any way in which I can convince python to pull 'q' into the local scope
> from within my C code?

Wouldn't this be a little surprising? Why not simply pass q as a parameter?

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to