Here's a noodler I could use some help on: I need a class that can
call a user-specified function with arbitrary (unknown) parameter
lists.  The trick, here, is that the user will dynamically specify the
funciton to invoke, and each function may differ in the number of
parameters passed during the call.  For instance, suppose I define two
dummy functions with different calling signatures:

def foo1(a1, a2, a3):
   ...

def foo2(a1):
  ...

Then I seek a class, Caller

class Caller(object):
   def execute(self, method, *parms):
      # some way to execute method

That can be used in the following manner:

>> c = Caller();
>> c.execute("foo1", 8, 9, 10)
>> c.execute("foo2", "me")

Any tips on tackling this?

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

Reply via email to