Re: names of parameters as string

From: Peter Otten (__peter___at_web.de)
Date: 10/30/04


Date: Sat, 30 Oct 2004 22:02:56 +0200

Steve Holden wrote:

> [No] guarantees to work on any specific implementation.

What do you mean - the locals() analogue to

globals()[name] = value

or my exec workaround?

def somefunc():
    value = as_you_like_it
    exec "%s = value" % name

inquisitively, far from Spain
Peter



Relevant Pages

  • Re: Difference between function and method
    ... The core question is: ... def gunc: ... are classes inherit from class A, how does name resolution work on this case? ... # wouldn't work if somefunc became a method ...
    (comp.lang.python)
  • Re: list modification subclassing
    ... I have a simple subclass of a list: ... def somefunc: ... work with append and extend you'll have to do the same sort of thing ...
    (comp.lang.python)
  • Re: * operator--as in *args?
    ... Is it a pointer? ... for documentation on them more fruitful? ... def someFunc(): pass ...
    (comp.lang.python)