James Stroud wrote: > Yes, those were typos. And to be consistent, the whole listing of the > configuration file should be (note: 'doit'->do_something_with): > > [foo] > param1 = float > param2 = 4 > > [option1] > __module__ = UserDefined1 > __function__ = do_something_with > param1 = str > param2 = 30.0 > > [doit] > param1 = float > param2 = float > > [etc.] > > > With the user's main having the following in it: > > from UserDefined1 import some_function > def foo(): [etc.] > def doit(): [etc.]
Why don't you just let your userse write def foo(param1=float, param2=4): ... and dump the config file? Alternatively you can devise a decorator @declare(float, int) def foo(param1, param2=4): ... The problem of mapping names to values, be they modules or functions, will magically vanish. Peter -- http://mail.python.org/mailman/listinfo/python-list