Re: Some python comments/questions

Jon Eisenberg (jke@u.washington.edu)
Wed, 13 Oct 1993 09:59:47 -0700 (PDT)

On Wed, 13 Oct 1993 Guido.van.Rossum@cwi.nl wrote:
> The change will break some existing Python code: statements calling
> exec() with an explicit global and/or local dictionary. The majority
> of exec() function calls will still work since the extra parentheses
> are harmless.
>
> How about it?
>
> --Guido van Rossum, CWI, Amsterdam <Guido.van.Rossum@cwi.nl>
I am developing a data analysis application using python as the interface
and user programming language. Your proposed change in exec would seem to
break it.

I use the feature of passing an explicit dictionary for the following
reason. I have a database with named entries on which I wish to perform
calculations. To evaluate an expression of the variables names, I create
an object with features named as the database entries are (by taking an
empty class and adding the features to it), then pass the objects
dictionary as the local namespace to the exec() call. That way I don't
have to parse the expression or clutter the local name space with
variables of the same name as the db entries. How could I accomplish the
same after your proposed changes?
--Jon

--
Jon Eisenberg
High Energy Physics Lab            e-mail:	jke@u.washington.edu
Physics Dept., FM-15                            (or jke@uwaphast.bitnet)
Univ. of Washington                phone:       206-543-6886  office
Seattle, WA 98195                  fax:         206-685-0635