t.i.d.maybeDeferred(f, *args, **kw) : function documentation

Part of twisted.internet.defer View Source

Invoke a function that may or may not return a Deferred.

Call the given function with the given arguments. If the returned object is a Deferred, return it. If the returned object is a Failure, wrap it with fail and return it. Otherwise, wrap it in succeed and return it. If an exception is raised, convert it to a Failure, wrap it in fail, and then return it.

ParametersfThe callable to invoke (type: Any callable)
argsThe arguments to pass to f
kwThe keyword arguments to pass to f
ReturnsThe result of the function call, wrapped in a Deferred if necessary. (type: Deferred)
API Documentation for Twisted, generated by pydoctor at 2012-12-26 12:18:15.