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 Newsgroups: comp.lang.python Subject: Re: PyEval_GetLocals and unreferenced variables Date: Wed, 03 Dec 2014 19:06:12 +1300 Lines: 10 Message-ID: References: <20141202093510.4af9791e@tigger> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net GDOEeKl89pR6zRxphlMbNwnRzOY0kxlUuqxckj1fEDy+RO1XIO Cancel-Lock: sha1:GEM/qIodAR5FtqKCciM/9//vobQ= User-Agent: Mozilla Thunderbird 1.0.5 (Macintosh/20050711) X-Accept-Language: en-us, en In-Reply-To: Xref: csiph.com comp.lang.python:81838 Ned Batchelder wrote: > I would use thread locals for this: > https://docs.python.org/2/library/threading.html#threading.local You could get dynamic scoping that way, but the OP seems to want lexical scoping. -- Greg