Martin Geisler <[EMAIL PROTECTED]> wrote: > Letting the callbacks take several arguments would definitely be the > nicest syntax, but I'm unfortunately restricted by the Twisted > framework: there all functions in a callback chain return one result > which is passed to the next callback as the first argument. That is why > I do a fair amount of tuple unpacking in my code. If you only have to contend with that one pattern then you could write a decorator to unpack a single argument. Maybe not ideal, but then you have the option to write:
@unpacked def product(a, b): return a*b ci.addCallback(product) or ci.addCallback(unpacked(lambda a,b: a*b)) for some suitable definition of unpacked. -- http://mail.python.org/mailman/listinfo/python-list