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

2008-12-03 Thread Helmut Jarausch
Duncan Booth wrote: Helmut Jarausch <[EMAIL PROTECTED]> wrote: Chris Rebert wrote: On Mon, Dec 1, 2008 at 1:01 PM, Helmut Jarausch <[EMAIL PROTECTED]> 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

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

2008-12-02 Thread Helmut Jarausch
Chris Rebert wrote: On Mon, Dec 1, 2008 at 1:01 PM, Helmut Jarausch <[EMAIL PROTECTED]> 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 ident

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

2008-12-02 Thread Duncan Booth
Helmut Jarausch <[EMAIL PROTECTED]> wrote: > Chris Rebert wrote: >> On Mon, Dec 1, 2008 at 1:01 PM, Helmut Jarausch <[EMAIL PROTECTED]> >> wrote: >>> Hi, >>> >>> I am looking for an elegant way to solve the following problem: >>> >>> Within a function >>> >>> def Foo(**parms) >>> >>> I have a lis

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

2008-12-01 Thread Peter Otten
Helmut Jarausch wrote: > 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'] > > for that I could write > > def Foo(*

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

2008-12-01 Thread Chris Rebert
On Mon, Dec 1, 2008 at 1:01 PM, Helmut Jarausch <[EMAIL PROTECTED]> 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

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

2008-12-01 Thread Helmut Jarausch
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'] for that I could write def Foo(**parms) : for N in VList : if N in pa