[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-list
Subject:    Re: PyEval_GetLocals and unreferenced variables
From:       Gregory Ewing <greg.ewing () canterbury ! ac ! nz>
Date:       2014-11-29 11:34:01
Message-ID: cdtp9bFsmvpU1 () mid ! individual ! net
[Download RAW message or body]

Kasper Peeters wrote:

>I have something like
> 
>     def fun():
>        cfun_that_creates_q_in_local_scope()
>        def fun2():
>            cfun_that_wants_to_see_if_q_is_available()
> 
> So the Python side actually doesn't see 'q' directly at all.
> 
> I am willing to elaborate on this if you want

I think you will need to elaborate. There are several things
about the way local scopes and references to outer scopes are
implemented in Python that makes what you are asking for
extremely difficult.

If you explain the problem you're actually trying to solve,
we'll probably be able to suggest a better solution.

-- 
Greg
-- 
https://mail.python.org/mailman/listinfo/python-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic