names of parameters as string

Steve Holden steve at holdenweb.com
Sat Oct 30 15:36:06 EDT 2004


Peter Otten wrote:

> Terry Reedy wrote:
> 
> 
>>"andrea valle" <andrea.valle at unito.it> wrote in message
>>news:1CC54D90-2A40-11D9-A5B8-0003939C968C at unito.it...
>>
>>>Suppose I have a string and I'd like to create a variable with its name.
>>>How can I do that?
>>
>>globals['varname'] = 3
>>
>>difficult or impossible for function locals
> 
> 
> Not difficult - only ugly, slow, and dangerous:
> 
Not only ugly, slow and dangerous but also not guarantees to work on any 
specific implementation.

nobody-expects-the-spanish-inquisition-ly y'rs  - steve
-- 
http://www.holdenweb.com
http://pydish.holdenweb.com
Holden Web LLC +1 800 494 3119



More information about the Python-list mailing list