Thanks alot Jeff. This worked for me:

formhandlers={}
for verb,verb_desc in PROVISION_ACTIONS:
        try:
                formhandlers[verb]=globals()[verb]
        except KeyError:
                pass


On Wed, 2004-12-29 at 14:37, Jeff Shannon wrote:

> If you can't make that change to PROVISION_ACTIONS, then you may be 
> able to use the name strings to pull function references from your 
> module's global dictionary --
> 
>      for verb, verb_desc in PROVISION_ACTIONS:
>          func = globals()[verb]
>          if callable(func):
>              formhandlers[verb] = func
> 
> though you'd probably want to put that globals() lookup in a 
> try/except block to catch any KeyErrors.


_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to