John Clark wrote: > locals()[var] > > But I am not sure what the pros/cons for doing something like this would > be...
locals() should be considered read-only. From the docs: locals( ) Update and return a dictionary representing the current local symbol table. Warning: The contents of this dictionary should not be modified; changes may not affect the values of local variables used by the interpreter. At global scope, locals() == globals() and modifying locals() will work. Within a function, modifying locals() will not do what you want. Kent _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor