[Twisted-Python] some callback function params problems

hoooooosety hoooooosety at gmail.com
Tue Jun 9 05:31:52 EDT 2009

Hello, I have some callback function params problems.

Here is a simple example.

def deferDoSomeInsert(paramA, paramB):
	insertSQL = "..."

def deferDoSomeDelete(paramA, paramB):
	deleteSQL = "..."

#these two functions are individual and basic, and then, I need compound function which first insert then delete.

def deferCompoundFunc(paramA, paramB):
	return deferDoSomeInsert.addCallback(deferDoSomeDelete, paramA, paramB)

here the problem comes, the first defer will return none as default so there're 3 pramas pass to the second function.

Is there a common way to solve the problem like this. I mean I can still keep the separate functions as the look like now,
and I can compound the basic function to do more complex action using addCallback to link them.


More information about the Twisted-Python mailing list