Roy Smith wrote:
> Can you give us some idea of what it is that you're trying to do? It pretty
> unusual to see
> a requirement like that.
def func(type_of_obj1, type_of_obj2, .....):
callfunc( [
type_of_obj1 and obj1a() or obj1b(),
type_of_obj2 and obj2a() or obj2b(),
....
])
callfunc can take arbitrary number of objects whose types are determined
by type_of_obj1 etc. I was using a bunch of if/else to create objects
and pass them to callfunc.
Since type_of_obj1 etc are usually binary and obj1a() etc will never be
false, the and/or solution does not look so bad in this case.
Thanks.
Bo
--
http://mail.python.org/mailman/listinfo/python-list