where is upvar

Kragen Sitaker kragen at dnaco.net
Thu Sep 21 20:11:20 EDT 2000


In article <yv28zsmfafv.fsf at lionsp093.lion-ag.de>,
Harald Kirsch  <kirschh at lionbioscience.com> wrote:
>My entrance into the world of python was to write a command line
>parser ala http://wsd.iitb.fhg.de/~kir/clighome/. It is quite natural
>to let the parser set variables directly in the calling stack frame,
>normally the __main__ of the script.

It is natural, but it could also be considered a bad idea.  If it's a
set of variables specified on the command line, it's definitely a bad
idea; if it's a set of variables specified in the script, it is a good
idea.  In C you'd do it by passing pointers to local variables to your
arg-parsing routine; can't do that in Python.
-- 
<kragen at pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Perilous to all of us are the devices of an art deeper than we ourselves
possess.
                -- Gandalf the Grey [J.R.R. Tolkien, "Lord of the Rings"]



More information about the Python-list mailing list