Is it safe to modify the dict returned by vars() or locals()

Helmut Jarausch jarausch at
Tue Dec 2 10:34:18 CET 2008

Chris Rebert wrote:
> On Mon, Dec 1, 2008 at 1:01 PM, Helmut Jarausch <jarausch at> wrote:
>> Hi,
>> I am looking for an elegant way to solve the following problem:
>> Within a function
>> def Foo(**parms)
>> I have a list of names, say  VList=['A','B','C1']
>> and I like to generate abbreviation
>> _A identical to parms['A']
> Could you explain what you mean by that? Your sample code doesn't seem
> to do any "abbreviation"...
> Otherwise I don't see why you don't just have a proper parameter list.

In my application parms contains field names of an html form iff these fields
have been modified.
I'd like to use the short name  _A  instead of the longer expression parms['A']

Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany

More information about the Python-list mailing list