Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #81718

Re: PyEval_GetLocals and unreferenced variables

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Gregory Ewing <greg.ewing@canterbury.ac.nz>
Newsgroups comp.lang.python
Subject Re: PyEval_GetLocals and unreferenced variables
Date Sun, 30 Nov 2014 00:34:01 +1300
Lines 23
Message-ID <cdtp9bFsmvpU1@mid.individual.net> (permalink)
References <20141126102257.141b108f@klug> <CAPTjJmov9s=_0yVSOYSRqoCoy69vyXCKvUpScirjBQDp28Sd4A@mail.gmail.com> <mailman.16317.1416998820.18130.python-list@python.org>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Trace individual.net P4fN4ryauFHP/j//wXc0yg1RqKOlZ4b4dOMGZCOCL2+p3nj79N
Cancel-Lock sha1:8OQRJ6erPfE8KpzPsfqNypxLTRU=
User-Agent Mozilla Thunderbird 1.0.5 (Macintosh/20050711)
X-Accept-Language en-us, en
In-Reply-To <mailman.16317.1416998820.18130.python-list@python.org>
Xref csiph.com comp.lang.python:81718

Show key headers only | View raw


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

Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Re: PyEval_GetLocals and unreferenced variables Kasper Peeters <kasper@phi-sci.com> - 2014-11-26 10:46 +0000
  Re: PyEval_GetLocals and unreferenced variables Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-11-30 00:34 +1300

csiph-web