Dynamic method parameter access?

Dennis Kempin dennis at xardias.net
Tue Feb 12 14:38:05 EST 2008


Hello,

I have a set of some objects. With these objects I want to call a Python 
method. But the writer of the method shall have the option to select 
from these objects as method parameter.

At the moment i use the following way to call a method with the a or b 
or both parameter.

try:
     method(a=value)
except TypeError:
     try:
         method(b=value)
     except TypeError:
	method(a=value, b=value)

This is getting really complex the more optional parameters I want to 
provide.
Is there any other way to access the method parameter?

Thanks in advance,
Dennis




More information about the Python-list mailing list