setting variables in the local namespace

Peter Pearson ppearson at nowhere.invalid
Tue Oct 13 20:57:29 CEST 2009

On Tue, 13 Oct 2009 17:05:03 +0100, Chris Withers wrote:
> - what is so wrong with wanting to set a variable in the local namespace 
> based on a name stored in a variable?

I'm not sure it's "so wrong" that one should never, ever do
it, but it *does* blur the boundary between the program and
the data on which the program operates.  Also, variable
names are customarily for the convenience of programmers, and
have often (e.g., compiled languages) disappeared by
run-time; so run-time references to variable names seem to
puncture the "what's for programmers" / "what's for the hardware"

It strikes me much as the question, "What's so wrong with having
a soda straw going from the driver's seat to the gas tank?"  Curious
question.  Go ahead!  Odd that it should seem desirable, though.
I hope the smart guys on this group can do a more precise job of
expressing this.

To email me, substitute nowhere->spamcop, invalid->net.

More information about the Python-list mailing list