Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feeder.erje.net!eu.feeder.erje.net!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Gregory Ewing Newsgroups: comp.lang.python Subject: Re: using getattr/setattr for local variables in a member function Date: Fri, 22 Nov 2013 17:07:49 +1300 Lines: 18 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net 6BY9owKmWICxNimCPoWHuwa5x0aNtC3kGV1SUBy6zTkU1d3hvy Cancel-Lock: sha1:CRHrOVeUx1lwfVrhTx9y7HeTi8M= User-Agent: Mozilla Thunderbird 1.0.5 (Macintosh/20050711) X-Accept-Language: en-us, en In-Reply-To: Xref: csiph.com comp.lang.python:60198 Catherine M Moroney wrote: > is there > some way to use getattr/setattr to access the local variables specific > to a given function? No, because those variables don't even exist when there isn't a call to the function in progress. Your example suggests that, instead of local variables, you really want them to be attributes of your object somehow. The best way to go about that will depend on how you want to use them. If you explain more about the problem you're trying to solve, we may be able to suggest a solution. -- Greg